|
Posted by Gordon Burditt on 11/15/05 20:47
>This script will report a success with the creation of the directory on
>my server, but fails to write a file inside the newly created
>directory.
>
>Originally, I only call mkdir without specifying any permission and it
>doesn't work. Thus I explicitly instruct mkdir to use 0777 to allow all
>write operation by everybody, in case PHP and Apache try to write files
>using "nobody" or "www" user account, instead of my shell login user
>account. Still it doesn't work. The owner of the created directory is
>called "www". When I login via SSH and check the permission, strangely,
>the permission is 775 instead, with Write permission for Others
>disabled, although I told mkdir to use 0777 instead.
Look up "umask". mkdir() and file creation are subject to the
umask, which by default doesn't allow world write.
Does the PHP user ("www" in your case) *own* the directory?
If not, and safe mode is ON, really getting mode 777 won't do any good.
Gordon L. Burditt
[Back to original message]
|