Wondering how to set custom php.ini in FastCGI? We can help you.
Most of the domains move to PHP nowadays. In a shared server, all of us want to set the PHP parameter according to the feasibility of domains.
In such a case, custom PHP plays an important role.
As part of our Server Management Services, we assist our customers with several FastCGI queries.
Today, let us discuss how to set custom php.ini in FastCGI.
With custom PHP, according to our requirements, we can set features like ‘maximum upload file size, maximum execution time’ etc.
Among the PHP handlers, in a shared server, due to a lack of resources, FastCGI is the best to manage resources for a high traffic site.
Moving ahead, our Support Techs show how to set custom PHP in ‘FastCGI’ as a PHP handler.
Set custom php.ini in FastCGI
To set a custom “php.ini” for the “FastCGI” PHP handler a few settings are to be done in the server.
Initially, we check the current PHP handler for the server:
# /usr/local/cpanel/bin/rebuild_phpconf –current Available handlers
If it is “FastCGI”, we proceed with the below-given steps to enable custom “php.ini”:
- Open the “.htaccess” file for the domain and add the below codes:
AddHandler php5-fastcgi .php Action php5-fastcgi /cgi-bin/php5.fcgi
- Then, move the php.ini file to the cgi-bin folder of the account and also change the permission of the file to “755”.
- Add the below-given code to the “cgi-bin” directory which is present inside the “public_html” file of the domain.
#!/bin/sh export PHP_FCGI_CHILDREN=1 export PHP_FCGI_MAX_REQUESTS=10 exec /usr/local/cpan el/cgi-sys/php5
- Eventually, save and quit the file.
- Then change the permission of the file “/home/user/public_html/cgi-bin/php5.fcgi” to 755.
Now, we have a custom PHP for our domain. Once this is done, we can set different PHP parameters.
For example, if want to install Drupal, we need to set the PHP parameter “Memory Limit” as 64MB which helps seamless installation of Drupal in our domain.
Though there is a never-ending stream of things to do, if we take care of the steps above, we can perform the task easily.
[Need help with the setting? We’d be happy to assist you]
In short, FastCGI is the best to manage resources for a high traffic site in shared servers. Here’s how our Support Techs set custom php.ini in FastCGI.