Posted by Colin McKinnon on 08/24/05 11:35
fingermark@gmail.com wrote:
> 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. 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.
It's because the webserver is not running as user 'foouser' so doesn't have
write permission to /home/foouser/public_html
If you can chown that dir to the webserver user it will work - but for most
intents and pruposes this would have the same effect as chmoding the dir to
0777
> 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?
No, IIRC, only root can change the privilege on a running process but
there's nothing to stop you creating a process running as foouser (although
this will need a *lot* of clever coding to get the process to do what you
want).
I did think about writing an I/O proxy in C to do exactly this - but after
worked out what was involved I had a sudden bout of apathy.
C.
[Back to original message]
|