Enabling Suexec and Suphp in cpanel serever

There are a number of differences between DSO (Apache Module) and SuPHP based PHP and you must address these items when converting an existing system to SuPHP else you may have some sites generating “Error 500”:

1. PHP scripts MUST have the account owner as the owner of the script
and cannot be user “nobody” or some other user as the script owner.

2. PHP scripts CANNOT be located in a folder with writable global
permissions which means no “666” or “777” folders.

3. Per #2, the PHP scripts themselves cannot be globally writable

NOTE: Global writable is not only not permitted under SuPHP but also not required either. You can ignore script instructions telling you to set 777 permissions when running under SuPHP

4. The commands “php_flag” and “php_admin” used to override
PHP configuration settings under DSO based php do not exist under
SuPHP and those commands are invalid in .htaccess and httpd.conf.

You can use the following script to correct the above four things in Linux based Cpanel servers to correct the above 4 items after you run EasyApache ato SuPHP …

cd  /usr/local/src
chmod 0700  dso2su.sh
/etc/init.d/httpd restart

This script is not designed to convert your system to SuPHP but rather to fix the Error 500 and compatibility issues you will need to fix on existing sites after you have converted your system to SuPHP and will examine all sites on your server and apply fixes for those 4 items I just listed.

To know the current php handler use the command

/usr/local/cpanel/bin/rebuild_phpconf –current

If the size of /usr/local/apache/logs/suphp_log is greater than 2GB then you will receive 500 internal server error.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s