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.


USED SKAR AUDIO SK-M5001D 500W RMS ULTRA COMPACT CLASS D MONOBLOCK CAR AMPLIFIER picture

USED SKAR AUDIO SK-M5001D 500W RMS ULTRA COMPACT CLASS D MONOBLOCK CAR AMPLIFIER

$101.99



Simplex 4100-1315 566-677 Fire Alarm 4100 NAC Amplifier picture

Simplex 4100-1315 566-677 Fire Alarm 4100 NAC Amplifier

$809.95



Simplex 4100-1315 566-204 Fire Alarm 4100 NAC Amplifier picture

Simplex 4100-1315 566-204 Fire Alarm 4100 NAC Amplifier

$799.95



SIEMENS 00353445 SERVO AMPLIFIER S04 NEW picture

SIEMENS 00353445 SERVO AMPLIFIER S04 NEW

$366.32



Est 3-za40a Class A Or B Audio 40 Watt Amplifier picture

Est 3-za40a Class A Or B Audio 40 Watt Amplifier

$549.99



Copley Controls 412CE DC Brush Servo Amplifier 90v 10/20 Amps picture

Copley Controls 412CE DC Brush Servo Amplifier 90v 10/20 Amps

$399.00



AudioSource AMP 5.1A Monoblock Power Amplifier NICE * picture

AudioSource AMP 5.1A Monoblock Power Amplifier NICE *

$37.00



2pcs Electric Bluetooth 5.0 Stereo Sound Amplifier Circuit Board Module 3.7-5V picture

2pcs Electric Bluetooth 5.0 Stereo Sound Amplifier Circuit Board Module 3.7-5V

$8.73



NEW FIREYE MAUV1 UV AMPLIFIER MODULE picture

NEW FIREYE MAUV1 UV AMPLIFIER MODULE

$150.00



🔥BOSCH 0 811 405 144 amplifier, 0.8A 24V, Used, 🇺🇸 picture

🔥BOSCH 0 811 405 144 amplifier, 0.8A 24V, Used, 🇺🇸

$130.00



Powered by WordPress. Designed by WooThemes