Federico Cargnelutti

Simple is better than complex. Complex is better than complicated. | @fedecarg

Run PHP scripts with different users on the same server

leave a comment »

suPHP is a tool for executing PHP scripts with the permissions of their owners. It consists of an Apache module (mod_suphp) and a setuid root binary (suphp) that is called by the Apache module to change the uid of the process executing the PHP interpreter.

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. In addition to that you probably won’t have to use PHP’s “safe mode”, which applies many restrictions on the scripts.

Stuart Herbert wrote an article explaining how to secure a shared server using suPHP:

The challenge with securing a shared hosting server is how to secure the website from attack both from the outside and from the inside. PHP has built-in features to help, but ultimately it’s the wrong place to address the problem. Apache has built-in features too, but the performance cost of these features is prohibitive. This has created a gap that a number of third-party solutions have attempted to fill. One of the oldest of these is suPHP, created by Sebastian Marsching.

Read more: Using suphp To Secure A Shared Server

Written by Federico

August 10, 2008 at 8:11 pm

Posted in PHP, Security, Tools

Leave a Reply