jes5199 Asked: 2009-05-13 15:50:37 +0800 CST2009-05-13 15:50:37 +0800 CST 2009-05-13 15:50:37 +0800 CST How do you run a PHP script as the file's owner, rather than as the webserver user? 772 I'm sure there's a well-known answer for this, but I can't seem to find it. How do I make a user's PHP scripts (in ~user/public_html, for example), run as the owner rather than as (eg) www-data? Assume Apache, Linux, and PHP 5. php setuid 1 Answers Voted Zoredache 2009-05-13T16:05:57+08:002009-05-13T16:05:57+08:00 One option is to use suPHP. http://www.suphp.org/DocumentationView.html?file=apache/INSTALL The suPHP Apache module together with suPHP itself provides an easy way to run PHP scripts with different users on the same server. It provides security, because the PHP scripts are not run with the rights of the webserver's user.
One option is to use suPHP.
http://www.suphp.org/DocumentationView.html?file=apache/INSTALL