Disable Use Of Custom PHP.INI files On cPanel Server

When compiling Apache using cPanel’s EasyApache application, you have the option of installing ‘Mod suPHP’, which is just one of many options that make your php installation more secure when hosting multiple sites on the same server; e.g. shared hosting server.

When you have Mod suPHP installed, you can configure your server to force the use of the main server wide php.ini file and disable the use of custom php.ini files to adjust certain php settings. To do this:

1. Login to your server as root via SSH

2. Open the following file:

nano /opt/suphp/etc/suphp.conf

3. Search for [phprc_paths] and then uncomment (remove the ; from the front) the following lines:

;application/x-httpd-php=/usr/local/lib/
;application/x-httpd-php4=/usr/local/php4/lib/
;application/x-httpd-php5=/usr/local/lib/

Save the file, exit the editor, and then restart Apache

Important Note

Some popular modern php applications require quite generous php resource allowances(memory, to function, so it you enable this limitation, you need to make sure you have configured your default, server wide php.ini with settings that will these applications to run without issues.