Overview

This interface allows you to easily manage the PHP and PHP-FPM configurations of your system and your cPanel accounts. In this interface, you can manage the PHP version, PHP-FPM setting, pool options, and PHP INI directives of any virtual host that you own.

Note:

To remove the CloudLinux™ promotions, log in to your Manage2 account, navigate to the Update Company Information section. Then, select the Disabled button next to the Purchase CloudLinux Url or email address option. You can only disable this option if you possess a Partner account.

The PHP Version tab

The PHP Version tab allows you to select the System PHP version, the version of PHP for each domain, and to manage PHP-FPM on each domain.

The System PHP version section

The system PHP version refers to the version of PHP that functions as the global default for all accounts. Only the system administrator can set the System PHP version. When you create a new account, the account uses this version of PHP by default. Also, any primary domain that you set to Inherit will use the System PHP Version. For more information, read our PHP Inheritance documentation.

To change the system default PHP, perform the following steps:

Click Edit in the System PHP Version section.

Select your desired PHP version from the menu.

Click Apply.

Notes:

When you change the system default PHP version, the interface writes to the /etc/cpanel/ea4/php.conf file. The system logs any changes made to this file to the /etc/cpanel/ea4/php.conf.bak/TIME.PID file, where TIME represents the time the system made the change and PID represents the process PID. The system only keeps the 20 most recent php.conf file changes.

The System PHP-FPM section

PHP FastCGI Process Manager (PHP-FPM) provides an alternative PHP module that allows a website to handle strenuous loads on sites. PHP-FPM maintains pools (workers available to respond to PHP requests) to accomplish this. These pools of workers allow the website to handle more requests than it normally could.

In cPanel & WHM, PHP-FPM is enabled by default as long as the system meets the RAM requirements listed in the warning below. System administrators can disable or enable PHP-FPM for all cPanel user accounts with this interface.

Warning:

We strongly recommend that you only activate Apache PHP-FPM if your server has at least 2 GB of RAM available, or at least 30 MB of RAM per domain. If you enable PHP-FPM on a server with less than the required RAM, your server may experience severe performance issues.

Disable System PHP-FPM Status

To disable System PHP-FPM Status, click Turn Off next to System PHP-FPM Status in the System PHP-FPM section. Your status will now display as Off and all of your accounts will no longer run with PHP-FPM enabled.

Enable System PHP-FPM Status

To enable System PHP-FPM Status, perform the following steps:

In the System PHP-FPM section, click Turn On next to System PHP-FPM Status. The system will display the Convert All Accounts to PHP-FPM button.

To convert all of your accounts to PHP-FPM, click Convert All Accounts to PHP-FPM. The system will display a message that it has started the conversion process.

Notes:

If your PHP version does not match the required PHP-FPM installed packages, the system will not allow you to convert all of your accounts to PHP-FPM.

When enabled, the system automatically enables PHP-FPM for new accounts, domains, subdomains, and addon domains that you create.

If you wish to see the conversion log, click the link in the success message.

The Set PHP Version Per Domain section

Warning:

Incorrect ownership of an .htaccess file may cause failures when you change an account's PHP version. The cPanel user account must own the .htaccess file that you want to change, and that file must use 644 permissions.

Set the PHP Version for selected domains

You can change the PHP version for selected domains at one time. To do so, perform the following steps:

Select the checkbox next to the domains that you wish to edit.

Select the desired version of PHP from the PHP Version menu. If you want the account to always use the parent domain's PHP version, select Inherit. An account that you set to Inherit with no parent domain uses the system default.

Note:

You can use Inheritonly when you have disabled PHP-FPM for the domain.

Click Apply to change the selected domains' PHP version.

Notes:

If you enabled PHP version restrictions on an account, all installed PHP versions still appear in this interface. For more information, read our How to Restrict a User's PHP Versions documentation.

If you enabled PHP-FPM on a domain and you change the domain's PHP version, the system will change the domain's PHP-FPM version to match the selected PHP version. If PHP-FPM is not enabled on your domain, the system changes the PHP and PHP-FPM versions separately.

Configure PHP-FPM for selected domains

You can also toggle the PHP-FPM setting for selected domains from this section. To do so, perform the following steps:

Select the checkbox next to the domains that you wish to change.

From the PHP-FPM menu, select On to enable PHP-FPM or Off to disable it.

Click Apply.

Note:

When you transfer domains between servers, the destination server will not inherit the source server's PHP-FPM setting. For more information on how to correct this, read our PHP-FPM documentation.

The domains table

In EasyApache 4, each domain or virtual host can use any currently-installed PHP version or currently-installed PHP-FPM setting. These domains are listed in the domains table in the PHP Versions tab.

The domains table displays the following information:

Domain — The domain's name.

Account — The domain's cPanel account username.

Account Owner — The reseller or root user who owns the account.

PHP Version — The PHP version that the domain currently uses, or whether the account inherited its PHP version.

PHP-FPM — The domain's PHP-FPM status. If set to On, the interface shows the Edit PHP-FPM button.

Note:

The system does not list aliases (parked domains) in the domains table.

You can manage a domain's PHP Version and PHP-FPM settings from their row in the domains table.

Select a PHP Version

To select a domain's PHP version, perform the following steps:

Search for the domain whose PHP version you wish to edit.

Select the desired version of PHP from the PHP Version menu in that row. If you want the account to always use the parent domain's PHP version, select inherit. An account that you set to inherit with no parent domain uses the system default.

The system will automatically update the PHP version once you select it. While the system applies the changes, your mouse pointer may become inactive.

Set a domain's PHP-FPM setting

Important:

If you select a domain with the PHP version set to Inherit, the system will not allow you to set PHP-FPM for that domain. You must either select a PHP version other than Inherit or not use PHP-FPM.

You can toggle a domain's PHP-FPM setting for the domain from its row in the domains table. To do so, perform the following steps:

Search for the domain whose PHP-FPM setting you wish to edit.

From the PHP-FPM column in the domains table, set the toggle to On to enable PHP-FPM or to Off to disable it.

Set a domain's PHP-FPM configuration

The Domain PHP-FPM Configuration interface allows you to configure a domain's PHP-FPM pool options and php.ini directives. To access this interface, click Edit PHP-FPM. This button appears at the end of a domain's row when you enable PHP-FPM for that domain. When you access the Domain PHP-FPM Configuration interface, the interface renames and replaces the contents of the PHP Version tab.

You can edit these options at the system level from the System PHP-FPM Configuration tab (WHM >> Home >> Software >> MultiPHP Manager >> System PHP-FPM Configuration tab).

PHP-FPM Pool Options

The PHP-FPM Pool Options section allows you to set automated pools (workers) for the specified domain. If you did not previously configure these settings, the interface will display the system pool option settings.

Click Edit PHP-FPM. The system will open the Domain PHP-FPM Configuration interface.

In the PHP-FPM Pool Options section, enter your desired options for Max Children, Process Idle Timeout, and Max Requests. The table below shows the default values and limits for each option. If you have changed the system values from their default setting, then the system will display the system values.

Pool Options

Default (in seconds)

Limit

Max Children

5

1-10,000

Process Idle Timeout

10

1-10,000,000

Max Requests

20

1-10,000,000

Note:

You must enter pool option limits that are 1,000 or over without commas in the text box. We show commas in these examples for legibility.

Click Save Configuration at the end of the form to save your changes. The system will display a success message.

PHP INI Directives

The PHP INI Directives section allows you to configure the available php.ini directives for the specified domain. You can also toggle a user's ability to override the system's directive settings. You can manage the following settings:

Directive

Description

Possible Values

Example

allow_url_fopen

Users can treat URLs as files.

Select the checkmark — On

Deselect the checkmark — Off

N/A

log_errors

Users can log errors.

Select the checkmark — On

Deselect the checkmark — Off

N/A

short_open_tag

The system can recognize code between the <? and ?> tags as a PHP source.

Select the checkmark — On

Deselect the checkmark — Off

N/A

doc_root

The PHP pages' document root.

Note:

You can edit this setting for the domain level only.

A valid filename path.

[% documentroot %]

Note:

When you specify a vhost document root for subdomains, the system does not escape the vhost correctly in the subdomain's PHP-FPM configuration file.

PHP-FPM does not process certain characters in the document root unless you add double quotes ("") around the document root.

You can also add the colon(:), semicolon (;), and parenthesis (()) characters to the document root.

error_log

The error log's filename.

Note:

You can edit this setting for the domain level only.

A valid log file name.

example_com.php.error.log

Note:

The system normalizes the period character (.) to an underscore character (_) for the domain. For example, the /home/example/logs/example.net.php.error.log file becomes the /home/example/logs/example_net.php.error.log file, where example represents the username and example_net represents the domain name.

The PHP Handlers tab

In EasyApache 4, each PHP version can use its own PHP handler. The PHP Handlers tab allows you to select the PHP handler that each version of PHP uses.

The list of PHP versions shows:

An installed PHP version.

The PHP handler that the PHP version uses.

To change the handler that a PHP version uses, perform the following steps:

Click Edit next to the version of PHP whose handler you wish to change.

Select the PHP handler from the menu.

Notes:

The menu only shows the PHP handlers that are compatible with your selected version of PHP.

You can only use the DSO handler with one version of PHP.

Click Apply.

Note:

When you change a PHP version's handler, the interface writes to the /etc/cpanel/ea4/php.conf file. The system logs any changes made to this file to the /etc/cpanel/ea4/php.conf.bak/TIME.PID file, where TIME represents the time the system made the change and PID represents the process PID. The system only keeps the 20 most recent php.conf file changes.

The System PHP-FPM Configuration tab

The System PHP-FPM Configuration tab allows you to configure the system's PHP-FPM pool options and php.ini directives. The tab contains two sections, PHP-FPM Pool Options and PHP INI Directives.

You can configure domain-level pool options and PHP INI directives through the Edit PHP-FPM button in the domains table. You can find the domains table in the PHP Version tab (WHM >> Home >> Software >> MultiPHP Manager >> PHP Version tab).

Note:

The PHP-FPM configuration settings at the domain level will retain their customized settings, even when you edit the system PHP-FPM configuration settings.

PHP-FPM Pool Options

The PHP-FPM Pool Options section allows you to set automated pools (workers) for all of the domains in your local server. If you did not previously configure these settings, the interface will display the system pool option settings.

You must enter pool option limits that are 1,000 or over without commas in the text box. We show commas in these examples for legibility.

Click Save Configuration at the end of the form to save your changes. The system will display a success message.

PHP INI Directives

The PHP INI Directives section allows you to configure the available php.ini directives for all of the domains in your local server. You can also toggle a user's ability to override the system's directive settings. This interface allows you to manage the allow_url_fopen, log_errors, short_open_tag, doc_root, error_log, disable_functions, and error_reporting directives.

Directive

Description

Possible Values

Example

allow_url_fopen

Users can treat URLs as files.

Select the checkmark — On

Deselect the checkmark — Off

N/A

log_errors

Users can log errors.

Select the checkmark — On

Deselect the checkmark — Off

N/A

short_open_tag

The system can recognize code between the <? and ?> tags as a PHP source.

Select the checkmark — On

Deselect the checkmark — Off

N/A

doc_root

The PHP pages' document root.

Note:

You can edit this setting for the domain level only.

A valid filename path.

[% documentroot %]

Note:

When you specify a vhost document root for subdomains, the system does not escape the vhost correctly in the subdomain's PHP-FPM configuration file.

PHP-FPM does not process certain characters in the document root unless you add double quotes ("") around the document root.

You can also add the colon(:), semicolon (;), and parenthesis (()) characters to the document root.

error_log

The error log's filename.

Note:

You can edit this setting for the domain level only.

A valid log file name.

example_com.php.error.log

Note:

The system normalizes the period character (.) to an underscore character (_) for the domain. For example, the /home/example/logs/example.net.php.error.log file becomes the /home/example/logs/example_net.php.error.log file, where example represents the username and example_net represents the domain name.

cPanel, WebHost Manager, and WHM are registered trademarks of cPanel, Inc. for providing its computer software that facilitates the management and configuration of Internet web servers. ®2018 All rights reserved.

cPanel, WebHost Manager, and WHM are registered trademarks of cPanel, Inc. for providing its computer software that facilitates the management and configuration of Internet web servers. ®2018 All rights reserved.