Hosting Theory

What is suPHP?

suPHP is a PHP handler for executing PHP scripts with the permissions of their owners. In other words, suPHP helps you avoid permissions issues when running your php scripts.

On a default setup where PHP runs as a DSO (Dynamically Loadable [Apache] Module), when your script writes a file it does so under user ‘nobody’. In order to write a file on a linux box the permissions of the folder have to allow write access for your user. As an example, if you want to write a file — or write to a file — through a PHP script which is running PHP as DSO (apache user ‘nobody’) to folder /home/servint/public_html the permissions of the folder would have to be set to 777 (world-writable permissions). Alternatively, the pre-existing file to which you were writing would have to have 777 permissions.

When running PHP as suPHP all of your PHP scripts are executed as the user whose home directory you are in. Using the example above, if you were to run a PHP script in /home/userA/public_html/write-a-file.php the file would be executed as user ‘userA’ (the owner of the account).

The downside of using suPHP is that it causes a lot of additional CPU usage. For each PHP process/script which is executed, a separate CGI process is started (under your user) which actually executes the script. The amount of additional CPU which is used varies depending on the content of your script.

To Install suPHP on cPanel/WHM, see our article on the topic.

Find out more about ServInt solutions

Starting at $25

  • Hosting Advice
  • Computer World
  • Ars Technica

  • The New York Times
  • The Seattle Times
  • Bloomberg
  • The Hill

To engage with the ServInt Sales Team use the following chat icon. Normal sales hours are Monday-Friday 9am-5pm EST but feel free to leave a message and we will follow up as soon as possible.

Sales Chat

To engage with the ServInt Support Team you must be logged into our Customer Portal for identity verification and have a ticket opened about your request or there will only be limited support offered.

Support Chat