Actually running from command prompt (Im on Win2003) would be preferable, however in the past I found that I got permission problems when doing that. I was unable to write to files using PHP, even though it worked fine when run through the browser.
I tried to give the write permissions on the file to php-cgi but couldn't figure out how to do it.
Because relative filepaths are relative to php's current working directory. The current working directory is not the same directory as where the script lives when run via the cli, unlike the typical webserver enviornment.
I dont remember but I just know that it stopped working when it came to writing to a file.
When PHP run through Apache, the unix user is that of Apache. Eg. www or something similar. When you run a script from the command line, it is run as the current user. On unix systems, files have three types of permissions; user, group and global. Each of these roles can have read, write or execute rights. If you create a file under one user and set the permissions so that other users can access them, well then other users can't access them. You can solve it by putting both users in the same group, set the group ownership to this for the files that need to be shared and finally set group permissions to the same as user permissions (read+write for files and read+write+execute for directories).
Oh, and if you have open_basedir or safe_mode turned on for PHP, things gets a bit more complicated.