Page 1 of 1

Add custom php.ini for servers running FastCGI

Posted: Thu Feb 21, 2013 3:51 pm
by a24uall
Create a custom php.ini under the folder "cgi-bin" and alter the required php values
cd /home/USERNAME/public_html/cgi-bin/
vi php.ini
You need to give that file 755 permission to work.
chmod 755 php.ini
Create a file named "php5.fcgi" under "/home/USERNAME/public_html/cgi-bin/"
cd /home/USERNAME/public_html/cgi-bin/
vi php5.fcgi
Add the below lines in that
#!/bin/sh
export PHP_FCGI_CHILDREN=1
export PHP_FCGI_MAX_REQUESTS=10
exec /usr/local/cpanel/cgi-sys/php5
You need to give that file 755 permission to work.
chmod 755 php5.fcgi
Now add the below lines to the end of .htaccess
vi .htaccess
AddHandler php5-fastcgi .php
Action php5-fastcgi /cgi-bin/php5.fcgi
save and exit.

Try checking with a phpinfo page to make sure it works