note 2224 modified in fopen by ronabop
| From: | ronabop@php.net | Date: | Sat, 02 Sep 2000 06:45:15 +0000 |
| Subject: | note 2224 modified in fopen by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-3938@lists.php.net to get a copy of this message | ||
If you're running PHP as apache module, it will always write files as "nobody",
"www", "httpd", (or whatever user your webserver runs as) unless you specify a
different user/group in httpd.conf, or compile apache with suexec support.
However, if you run PHP as a CGI wrapper, you may setuid the PHP executable to whatever user you
wish (*severe* security issues apply). If you really want to be able to su to other user, I
recommend compiling with suexec support.
AFAIK, PHP can't NOT use SuEXEC if apache does. If PHP is configured as an apache module it
will act as whatever user the apache is. If apache SuEXEC's to otheruser:othergroup (e.g.
root:root), that's what PHP will write files as, because it acts as a part of apache code. I
suggest you double-check your SuEXEC configuration and settings. Note: you can't su to another
user within the PHP code -- it has to be an apache directive, either through <VirtualHost>, or
through .htaccess. Also note: I'm not sure how it all works (if it works at all) on Win32
platforms.
Check www.apache.org to see how it's done.
http://www.php.net/manual/function.fopen.php