Top Nav

Archive | PHP

Apache2 With mod_fcgid On CentOS 6.2

Need mod_fcgid on a CentOS 6.2 or similar server? Check out this great how-to:

I especially like the use of suexec.

This howto worked on the first try! There are not many actual working mod_fcgid howtos!

One issue that I did run into is the default MaxRequestLen is 131768 which is way to low so had to add this line:

to /etc/httpd/conf.d/fcgid.conf.



Disable PHP zlib.output_compression

If you need to disable zlib output compression from the .htaccess file, then just add the following line to the top of the file:



To Many PHP Session Files

I seen several servers with high traffic PHP sites hosted on Plesk servers building up an excessive number of PHP session files in /var/lib/php/session. Typically we discover this problem when the server runs out of inodes on the root filesystem.

Plesk provides a cronjob that runs hourly to clean up PHP session files:

For low traffic sites this script work just fine. But for high traffic sites with thousands of sessions per hour the script is too slow and can’t keep up with the rate that files are created.

The problem is the script check each files using the “fuser” utility to determine if the file is in use. This is a slow process. So on these high traffic servers I’ve found it necessary to remove the “fuser” check. Edit /etc/cron.hourly/plesk-php-cleanuper and change this line:


Now the session cleanup will run smoothly.


Apache mod_fcgi on CentOS 6.4

There are a lot of tutorials on how to install mod_fcgi with suexec out there but many are incomplete, outdated or just don’t work. One that does work is here:



Plesk 11.5 with Multiple PHP Versions

The latest version of Plesk support multiple PHP versions. The user or admin can select the version from the control panel.

Once you have the PHP versions installed use  the /usr/local/psa/bin/php_handler utility to inform Plesk. for example:

Also here’s an article that shows how to build the alternate version on Debian, including accurate info about necessary patches: