For cPanel & WHM version 66
(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.
This interface only appears if your server runs EasyApache 3. We strongly recommend that you upgrade your server to run EasyApache 4.
In EasyApache 4, you can perform the actions that this document describes in the following interfaces:
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
For more information about PHP handlers, read our PHP Handlers documentation.
To migrate from DSO to suPHP, perform the following steps:
Configure WHM for suPHP
In the PHP 5 Handler menu, select suPHP and click Save Configuration.
Update permissions and ownership
To update file 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
- Do not change the
public_htmldirectory owner. The
public_htmldirectory defaults to the
- 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.
- Do not change the
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
Run the following commands to remove the
php_flag settings from the
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/php.inito the user's home directory.
Add the new values to the user's
If an invalid
php.inifile resides in the user's directory, suPHP defaults to the
php.inifile in the
- For each directory that contains PHP scripts that require the custom settings, add
suPHP_ConfigPath /home/username/to the
.htaccessfile in the folder that contains the PHP script.