How to add custom php.ini for servers running FastCGI
Written by Abner Myloth Tuesday, 10 August 2010
Most of our servers run PHP as CGI module (needed for suPHP).
Check http://stats.server.arvixe.com/phpinfo.php
say, http://stats.monkey.arvixe.com/phpinfo.php
The Server API will be listed as “CGI”.
In these servers you can create a custom php.ini inside your public_html and the domains will load this configuration instead of the global php.ini
Our few servers have PHP as FastCGI. Setting a custom php.ini for this PHP handler will need a few settings to be done at the customer’s end.
In these servers the Server API will be listed as CGI/FastCGI.
http://stats.server.arvixe.com/phpinfo.php
say, http://stats.mole.arvixe.com/phpinfo.php
Below are the steps to enable custom php.ini for FastCGI PHP handler:
Open .htaccess of the user and add the below codes:
AddHandler php5-fastcgi .php
Action php5-fastcgi /cgi-bin/php5.fcgiMove to the cgi-bin folder of the account
cp /usr/local/lib/php.ini /home/user/public_html/cgi-bin/
Note: (contact us to copy the global php.ini to your cgi-bin or you can create an empty php.ini file)
chmod 755 /home/user/public_html/cgi-bin/php.ini
cd /home/user/public_html/cgi-bin/
vi php5.fcgi (insert the below codes and save)
#!/bin/sh
export PHP_FCGI_CHILDREN=1
export PHP_FCGI_MAX_REQUESTS=10
exec /usr/local/cpanel/cgi-sys/php5Save and quit the file
chmod 755 /home/user/public_html/cgi-bin/php5.fcgi
