View Full Version : PHP and CHMOD problem

01-28-2007, 11:23 PM
I have 2 php scripts, 1 detects pics in a folder and displays them the other is a file uploader (to upload pics to a dir to be detected)

The first works fine but when i chmod the dir the other doesnt work

The first time I tried this for a mates site I didnt have any problem, I cant for the life of me do it again, the chmod (777) seems to cancel the pic detect script

someone mentioned including a chmod into one of the scripts but im a novice at this so dont have a clue.

The dir has a php file there for the file detection

any ideas?

01-29-2007, 09:03 AM
Check this notes from php documentation about chmod

Note: The current user is the user under which PHP runs. It is probably not the same user you use for normal shell or FTP access. The mode can be changed only by user who owns the file on most systems.

Note: This function will not work on remote files as the file to be examined must be accessible via the servers filesystem.

Note: When safe mode is enabled, PHP checks whether the files or directories you are about to operate on have the same UID (owner) as the script that is being executed. In addition, you cannot set the SUID, SGID and sticky bits.