Page tree
Skip to end of metadata
Go to start of metadata

Overview

In cPanel & WHM version 58, we created a PHP patch that forces an EasyApache 4 system to read its php.ini files in the same order as an EasyApache 3 system. 

Patch behavior

Your system's PHP handler determines how your system behaves with this patch and which global values the system uses.

If you use the CGI or DSO PHP handler, the system uses the global values that the /opt/cpanel/ea-php##/root/etc/php.d/local.ini and /opt/cpanel/ea-php##/root/etc/php.d/*.ini files define. If your system uses the suPHP PHP handler, the presence of the suPHP_ConfigPath directive determines whether the system reads the .ini files in the /opt/cpanel/ea-php##/root/etc/php.d/ directory. 

Your PHP handler determines your system's behavior:

CGI or DSO

The system only uses the values that the /opt/cpanel/ea-php##/root/etc/php.ini file or the.ini files in the /opt/cpanel/ea-php##/root/etc/php.d/ directory specify.

SuPHP

If you do not set the suPHP_ConfigPath directive in your .htaccess file, the system loads the values in your php.ini files and the values in the local.ini files in the /opt/cpanel/ea-php##/root /etc/ php.d directory. If a user-defined php.ini file exists, the system will override the values that the files in the /opt/cpanel/ea-php##/root/etc/ php. d/ directory set.  

If you set the  suPHP_ConfigPath directive in your .htaccess file, the system does not load configurations in the /opt/cpanel/ea-php##/root /etc/php.d/ directory.  Instead, it loads the settings in the  php.ini file that the directive specifies. The php.ini file that the directive specifies takes precedence over the global configuration file. 

Important:

If you set the suPHP_ConfigPath directive, the specified php.ini file must be a complete .ini file.  Run one of the following commands to ensure that your users receive a complete php.ini file.

  • If you previously used WHM's MultiPHP INI Editor interface (Home >> Software >> MultiPHP INI Editor) to change your settings, the system created a local.ini file. If this file exists, use the following command:
cat /opt/cpanel/ea-php##/root/etc/php.d/*.ini > /path/to/specified/php.ini
  • If you have not used the MultiPHP INI Editor, run the following command to combine your existing files. If the local.ini file already exists, this command may cause some modules to load more than once.
cat /opt/cpanel/ea-php##/root/etc/php.ini /opt/cpanel/ea-php##/root/etc/php.d/*.ini > /path/to/specified/php.ini


Additional documentation