For cPanel & WHM version 11.50
(Home >> Service Configuration >> Configure PHP and SuExec)
This interface allows you to change Apache’s PHP handlers configuration, PHP version, and enable or disable suEXEC.
Change the default PHP version
You can define which version of PHP the system uses when Apache serves a
To change the default PHP version, select the version of PHP that you wish to use from the Default PHP Version (.php files) menu and click Save New Configuration.
Enable or disable Apache suExec
When you enable suEXEC, Apache runs CGI software as the account owner rather than as the
To enable or disable suEXEC, select on or off from the Apache suEXEC menu and click Save New Configuration.
To test your new configuration, select the Do a dryrun checkbox. This feature allows you to verify the new configuration before deployment. After you click Save New Configuration, click Apply Settings in the following interface to apply the new settings to your PHP configuration.
Define a PHP handler
A PHP handler calls the PHP libraries that the system requires to interpret the PHP code. The handler that you choose determines the libraries that the system accesses. You may assign different PHP handlers to different versions of PHP.
To define new PHP handlers, perform the following steps:
- Select the handlers that you wish to handle one or both versions of PHP.
- In the PHP 5 Handler menu, select the handler that you wish to use.
- Click Save New Configuration.
Migrate from DSO to suPHP
To migrate from DSO to suPHP, perform the following steps:
For more information about PHP handlers, read our PHP Handlers documentation.
Step 1: Configure WHM for suPHP
In the PHP 5 Handler menu, select suPHP and click Save Configuration.
Step 2: Update permissions and ownership
Perform the following changes inside each user's
- Change the permissions of files to
644and directories to
- Change the ownership of the files and directories within the
user:user. Do not change the
public_htmldirectory owner. The default owner is
- Do not make any changes to the directory itself.
- If you change ownership or permissions of files outside of the
public_htmldirectory, you may cause problems with other aspects of the account, such as mail.
Step 3: Edit the .htaccess files
If you previously allowed PHP customizations through
.htaccess files, you must remove or comment out all
php_flag settings in the user
We strongly recommend that you perform a backup before you make changes to your
The following commands remove the
php_flag settings from the
Step 4: PHP customizations
To allow PHP customization, create a custom
php.ini file in the user's directory.
To create a custom
php.ini file, perform the following steps:
- Copy the server's
/usr/local/lib/) to the user's home directory (For example,
- Add the new values to the user's
php.ini file in the user's directory is not valid, suPHP defaults to the
php.ini file located in the
For each directory that contains PHP scripts that require the custom settings, add
suPHP_ConfigPath /home/username/ to the
.htaccess file in the folder that contains the PHP script.