Page 1 of 1

what are preconditions for making mkdir() working ?

Posted: Fri Jun 16, 2006 3:17 am
by olko
Hi everybody,

I am running Suse 10.1 installation of LAMP.

There is a directory, let's say /foo - created by root, ownership is changed - Apache is the owner,
PHP runs as Apache module. If I am not mistaken PHP has the same rights as Apache.

What else should I do to make mkdir() able to create new directories in /foo ?

Thank you,
Yuri

Posted: Fri Jun 16, 2006 3:58 am
by neophyte
chmod 0777 on the directory other wise you won't be able to write and thus won't be able to make a directory.

Posted: Fri Jun 16, 2006 4:56 am
by olko
what are consequences of making it 0777?
will everybody accessing the website able to write in the directory ?

Posted: Fri Jun 16, 2006 5:07 am
by olko
Another thing - PHP runing as Apache module has Apache's rights, moreover it's Apache self.
I've already changed the ownership of /foo to Apache, it's 0755 in the /foo permissions.

It's logical to expect that PHP is able to write in /foo.

Do you happen to know why it should be 0777?
I am bit worried by giving to 'others' write permisssions..

Posted: Fri Jun 16, 2006 5:12 am
by olko
btw..

php is able to write a file in /foo even with 0755..
why it needs 0777 for mkdir ?