How to add suPHP_ConfigPath in fast-cgi PHP module


Setting a custom php.ini for FastCGI PHP handler will need a few settings to be done in the server.

In these servers, the Server API will be listed as CGI/FastCGI.

Check: http://domain.com/phpinfo.php

Below are the steps to enable custom php.ini for FastCGI PHP handler:


1. Open .htaccess file of the user and add the below codes:

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

2. Move php.ini file to the cgi-bin folder of the account

cp /usr/local/lib/php.ini /home/user/public_html/cgi-bin/

chmod 755 /home/user/public_html/cgi-bin/php.ini

3. 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/php5

Save and quit the file

4. chmod 755 /home/user/public_html/cgi-bin/php5.fcgi

Done :)

Comments

Post a Comment

Popular posts from this blog

SVN: File remains in conflict

HowTo: Enable extended logging for exim

12 tweakings for WHM/cPanel to speed up WordPress