|
Posted by Erwin Moller on 08/24/05 11:14
fingermark@gmail.com wrote:
Hi,
> i have the make.php located on my server. the only line of code is
> mkdir("/home/foouser/public_html/newdir", 0755);. now
> /home/foouser/public_html is "drwxr-xr-x 7 foouser foouser". with
> just that code i get permission errors.
As expected.
When you run a PHP script, that script runs almost in all cases as user
APACHE, often called: nobody, www-data, or just apache.
That user DOES NOT HAVE WRITEPERMISSION in the directory.
So, solutions:
1) Open up the directory to the world. (not wise maybe)
2) Make sure the user that runs php is in the same group as foouser, and
give the group writepermission.
3) Make a new directory in /home/foouser/public_html/forapache with:
drwx------ apache apache
or something that suits your needs.
Regards,
Erwin Moller
i am running make.php from a
> remote machine. so how can i get mkdir to create a directory in
> /home/foouser/public_html without chmodding anything to 777. would
> adding some type of authentication system to make.php work so that i
> could let the server know that i'm foouser on my remote machine?
[Back to original message]
|