Add custom php.ini for servers running FastCGI

Post Reply
a24uall
Site Admin
Posts: 166
Joined: Sun Jul 01, 2012 9:07 am

Add custom php.ini for servers running FastCGI

Post 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
Arun
WebhostingDevelopment.com
Post Reply

Return to “Custom php.ini”