Marco Tabini wrote...

>> I need to chmod files which are owned by a nother user than nobody with a
>> php script runing from a browser.
>> lets say i have a file called image.gif and I want to chmod(imgage.gif,
>> 0777); and I want to run it as user: myuser with passwd: passwd.
>> Can I do this?
> There was actually a brief thread about this last night. If you're using
> Apache, you could look into suexec--this may or may not be a possibility
> depending on the degree of control that you have on your server.

The short answer is "no".

My provider uses suexec, but that just means that Apache and its processes
run as (in my case) "dhapache" instead of "nobody", putting you in the same
boat with the same paddle.

I'm not sure why PHP doesn't let you fopen() with a user name and password.
It seems obvious, so I assume there are technical issues that prevent this
from happening.

My solution (for now) was to use FTP, since I will have the user's FTP
username/password.  Worse, I can't depend on the FTP commands (my provider's
PHP doesn't have them), so I'm using fsockopen() to "speak FTP" to do things
like delete files I've created with fopen().  This is far slower and more
error-prone, and I'm very, VERY interested in other portable solutions.

Please post whatever you find about this to the list, and I'll do the same.

Charles Wiltgen

   "Well, once again my friend, we find that science is a two-headed beast.
    One head is nice, it gives us aspirin and other modern conveniences...
    but the other head of science is bad!  Oh beware the other head of bites!" -- The Tick

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to