mod_suphp installation on Plesk 11

suPHP is a tool for executing PHP scripts with the permissions of their owners rather than Apache user and hence improves server security.

Below are the pros and cons of SuPHP

Pros ::

  • PHP runs as your user/group
  • Max File permission of  644 and max folder permisson of 755 required to execute PHP files
  • Files/folders written by PHP are written as account user/group instead of Apache user
  • Allows you to configure custom php.ini for each account


  • Slower than mod_php
  • PHP variable settings will no longer work from .htaccess files

Installation ::

Setup the RPMforge repo

for Centos 6.x 64 bit

rpm -ivh

for Centos 6.x 32 bit

rpm -Uvh

Now you can install mod_suphp via yum

yum install mod_suphp

Configuration ::

Insert below lines to  /etc/suphp.conf file

;Path to logfile


;User Apache is running as

;Path all scripts have to be in

;Path to chroot() to before executing script

; Security options

;Check wheter script is within DOCUMENT_ROOT

;Send minor error messages to browser

;PATH environment variable

;Umask to set, specify in octal notation

; Minimum UID

; Minimum GID

;Handler for php-scripts

Insert the below lines to /etc/httpd/conf.d/mod_suphp.conf

LoadModule suphp_module modules/

### Uncomment to activate mod_suphp
suPHP_AddHandler php5-script

# This option tells mod_suphp if a PHP-script requested on this server (or
# VirtualHost) should be run with the PHP-interpreter or returned to the
# browser "as it is".
suPHP_Engine on

Insert the below lines to /etc/httpd/conf.d/php.conf file

# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.

LoadModule php5_module modules/

# Cause the PHP interpreter to handle files with a .php extension.
AddHandler php5-script .php
AddType text/html .php

# Add index.php to the list of files that will be served as directory
# indexes.
DirectoryIndex index.php

# Uncomment the following line to allow PHP to pretty-print .phps
# files as PHP source code:
#AddType application/x-httpd-php-source .phps


Vhost configuration

Add the below lines to vhost.conf to activate mod_suphp

suPHP_Engine On
suPHP_UserGroup username psacln
suPHP_ConfigPath /var/www/vhosts/


finally restart apache/httpd service for the changes to take effect.