Using a custom php.ini when using FAST CGI (fcgi) in Cpanel WHM

When using FastCGI (FCGI) as the loader for PHP, traditional php_values in the .htaccess file as well as custom php.ini files in the public_html directory no longer work. Instead we must create a wrapper for the main FCGI binary that causes the php.ini to be loaded from it’s current working directory instead of the server-wide one.

Edit the .htaccess file in the directory you want to use a custom PHP configuration for and add the following lines to the bottom of the file:

AddHandler php5-fastcgi .php
Action php5-fastcgi /cgi-bin/php5.fcgi

Next, you’ll need to copy your your main server php.ini which is located in /usr/local/lib/. Also note that it needs to have the correct ownership.

cd /home/user/public_html/cgi-bin/
cp -a /usr/local/lib/php.ini .
chown user:user php.ini
chgrp user:user php.ini

Create a file in your current directory (cgi-bin) called  php5.fcgi as defined above and add the following:

#!/bin/sh
export PHP_FCGI_CHILDREN=1
export PHP_FCGI_MAX_REQUESTS=10
exec /usr/local/cpanel/cgi-sys/php5

Finally, make sure the ownership and permissions are correct on this file:

chown user:user php5.fcgi && chmod 0755 php5.fcgi
chgrp user:user php5.fcgi && chmod 0755 php5.fcgi

You can now edit the php.ini inside cgi-bin/ and change the desired values. You can verify they are set properly by inserting the phpinfo() function inside a PHPscript on that user account.


Hot Steam Cleaning HVAC Coil Bathroom Sterilize Disinfection Pressure Sprayer picture

Hot Steam Cleaning HVAC Coil Bathroom Sterilize Disinfection Pressure Sprayer

$249.99



GW Lisk 3633139 Solenoid Coil 12VDC 3/4

GW Lisk 3633139 Solenoid Coil 12VDC 3/4" ID

$79.95



ASCO 8551 Solenoid Valve 120v Coil picture

ASCO 8551 Solenoid Valve 120v Coil

$60.00



Performance G8 Aluminum Trim Coil - 24 in. x 50 ft. - Glacier White picture

Performance G8 Aluminum Trim Coil - 24 in. x 50 ft. - Glacier White

$105.99



8 Different Pre-Built Coils - 48 Pieces Total - Convenient Case picture

8 Different Pre-Built Coils - 48 Pieces Total - Convenient Case

$14.99



3/16

3/16" (4.76Mm) X 25' - 316L Marine Grade Stainless Steel Brake Line Tubing Coil,

$48.61



Distributor Ignition Coil 12 Volt For Ford Tractor Mount Coil 2N 8N 9N 9N12024 picture

Distributor Ignition Coil 12 Volt For Ford Tractor Mount Coil 2N 8N 9N 9N12024

$23.70



7709050-24VDC S1 R20= 27.0Ω IG=0.63A NEW SCHIENLE COIL picture

7709050-24VDC S1 R20= 27.0Ω IG=0.63A NEW SCHIENLE COIL

$370.00



Ignition Coil For Briggs & Stratton 2 3 3.5 4HP Engines 398593; IBS3001 picture

Ignition Coil For Briggs & Stratton 2 3 3.5 4HP Engines 398593; IBS3001

$30.67



Eaton 300AA00085A Soleniod Coil 115v-ac # 1049 picture

Eaton 300AA00085A Soleniod Coil 115v-ac # 1049

$100.00



Powered by WordPress. Designed by WooThemes