A custom php.ini in fastcgi server will be only active if following steps are followed:
1. Copy default php.ini to user's cgi-bin folder.
cd /home/user/public-html/cgi-bin
cp /usr/local/lib/php.ini /home/user/public_html/cgi-bin
2. Make necessary changes in it.
3. Create php.fcgi file in /home/user/public_html/cgi-bin folder, to load custom php.ini, with the contents below:
#!/bin/sh
export PHP_FCGI_CHILDREN=1
export PHP_FCGI_MAX_REQUESTS=10
exec /usr/local/cpanel/cgi-sys/php5
1. Copy default php.ini to user's cgi-bin folder.
cd /home/user/public-html/cgi-bin
cp /usr/local/lib/php.ini /home/user/public_html/cgi-bin
2. Make necessary changes in it.
3. Create php.fcgi file in /home/user/public_html/cgi-bin folder, to load custom php.ini, with the contents below:
#!/bin/sh
export PHP_FCGI_CHILDREN=1
export PHP_FCGI_MAX_REQUESTS=10
exec /usr/local/cpanel/cgi-sys/php5
Where /usr/local/cpanel/cgi-sys/php5 is the path of PHP 5 in a cPanel server. Check /etc/httpd/conf/php.conf to see what it shows for cgi-sys path for your version of PHP.
4. Save file and make it executable.
chmod +x /home/user/public_html/cgi-bin/php.fcgi
chown -R user:user /home/user/public_html/cgi-bin/
5. Edit .htaccess to point to php.cgi file.
cd /home/user/public_html
vi .htaccess
At the top of .htaccess, put the contents below:
AddHandler php5-fastcgi .php
Action php5-fastcgi /cgi-bin/php.fcgi
6. Add following lines to /usr/local/apache/conf/php.conf file:
Action php5-fastcgi /cgi-bin/php.fcgi
AddType application/x-httpd-php .php
7. Distill, rebuild Apache and then restart it.
/usr/local/cpanel/bin/apache_conf_distiller --update
/scripts/rebuildhttpdconf
/etc/init.d/httpd restart
Make sure the above values in php.conf files are not deleted with the update.
You can now test using a phpinfo page and make sure the 'Loaded Configuration' is correctly shown as /home/user/public_html/cgi-bin/php.ini
0 comments:
Post a Comment