For cPanel & WHM 11.46
(Home >> Service Configuration >> Configure PHP and SuExec)
This interface allows you to change Apache’s PHP handlers configuration, PHP version, and enable or disable the suEXEC program.
Change the default PHP version
You can define which version of PHP that the system will use when a visitor to a site on your server encounters 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 user ID of the account owner rather than as the user
To enable or disable suEXEC, select on or off from the Apache suEXEC menu and click Save New Configuration.
When you configure these options, to compile and view the PHP configuration file before you use it on your server, select the Do a dryrun checkbox at the bottom of the interface before you click Save New Configuration. Use this to check for errors and security flaws before Apache uses this PHP configuration. 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 are necessary for the system 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:
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 to
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
public_html, 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 will 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 and complete, the suPHP will default to the
php.ini file located at
For each directory that contains PHP scripts that require the custom settings, add
suPHP_ConfigPath /home/username/ to the
.htaccess file in the folder where the PHP script is located.