Revert PHP from mod_fcgid back to mod_php

Dear all,

with Update Virtual Servers (on centos/apache, virtualmin pro) trying to switch back the PHP execution mode to mod_php caused many difficulties with drupal sites.

Do manual changes have to applied too, for the switchback?
Which ones, in case?

I want to switch back because pages loads were faster with mod_php for me. On
I get:
Total loading time:
22.8 seconds
Total objects:
69 (449.6 KB)

It was less than half of that with mod_php.

Best regards,


Well, if you’re having problems, let us know and we can try and help on a case-by-case basis.

However, I suspect the issues may be related to permissions. With mod_php, you can’t use suexec, so Apache won’t always have permissions to be able to write to the various directories it may need access to.

After you make the switch to mod_php, take a peek in the Apache error logs if a site isn’t working – if it’s a permission issue, it should say so in there, as well as what directory it’s having trouble getting access to.


if you have long loading times in mod_fcgid then you may want to investigate your drupal sites before switching back. As mod_fcgid is just as fast as mod_php…per haps there are different settings in your general php.ini as opposed to your domains php.ini

as an example I tested my own site using mod_fcgid:
Website information

Total loading time: 8.1 seconds
Total objects: 130 (480.9 KB)

As you see I have more than twice the objects, a bigger total size, but it is loading at a third of your time.
This is a joomla site.

Here is a test with a drupal site in mod_fcgid

Website information

Total loading time: 1.6 seconds
Total objects: 43 (513.6 KB)

Dear Andre,
Dear Ronald,

many thanks for your interest in the question, and for your offer to go this through on a case by case bases eventually.

Ronald’s suggestion might be the best choice for the moment. The site is in development (t a p - w a t e r . c 0 m). I attached the fcgid.conf from httpd/conf.d, the php5.fci from fci-bin in the site’s root and the sites php.ini

Three typical notices in the httpd error log are:
[Sun Nov 08 23:47:15 2009] [notice] mod_fcgid: process /home/tap-water/public_html/index.php(4738) exit(lifetime expired), terminated by calling exit(), return code: 0
[Sun Nov 08 23:53:21 2009] [notice] mod_fcgid: process /home/tap-water/public_html/index.php(18677) exit(idle timeout), terminated by calling exit(), return code: 0

Host is linode, with centos, apache and virtualmin pro

Maybe you could help me tuning things, as the the site has to serve asap, that would be great.

Best regards,


P.S. Many thanks Ronald for helping me yesterday to get rid of bind dns feature error :slight_smile: see,

at the moment that site is loading actually quite fast, 7.7 s

but I would change a few things in the php.ini as attached

Dear Ronald,

many thanks for your help.

Switched the php.ini with your suggestions and got hieroglyphes on the site: please look at the attached screenshot.

Checked and tested your suggestions one by one: zlib.output_compression = On causes this problem. All the other ones are totally ok. Many thanks again for looking through my prior attachments, and for making the changes.

Compression is good I think, what should I try to get zlib running ok, you’ve got any idea what it could be?

For production, my aim is to load the site in roundabout 3 seconds with caching. Did tests with the boost module and got close to that, so I hope my aim is realistic. According to surveys shoppers expect a speedy site:

The setup of a system with drupal giving:
Total loading time: 1.6 seconds
Total objects: 43 (513.6 KB)
is fantastic.

I oriented myself by sun, as I think they do a good job, but compared to that speed they look quiet pale I would like to say, with:
Total loading time: 6.7 seconds
Total objects: 43 (552.9 KB)

Is it configuration or hosting, or both, you think?

I’m very interested in your insights, especially since I do the site with drupal too.

Best regards,


There are of course, as many other things, different approaches.

But even if your server and your ISP have enough bandwidth and speed, the client may be still on a crappy modem, making your site load slowly for that client.

So if speed is essential to you, you could contemplate about creating a landing page.
Just a simple static html page that will load fast even if the client is on a crappy connection.
He can then click on any link taking him to the real site. Since he decided to check your site out, speed is of less concern (all though 22 seconds is a turn off in any case)

You can optimise your drupal site, your server and you have to be certain that the lines/switches/router of your ISP are fast enough so no congestion is slowing down your site.

6 to 7 seconds loading time is good for a php/sql driven site. If you want it faster then the Drupal documentation may enlighten you to speed things up a little. But for starters I would personally create an optimised landng page.

To optimise any CMS stick with the core and avoid third party components/modules/banners/flash etc…

As for the zip.compressed output, it depends on the Drupal version, you can add it to .htaccess instead of php.ini and there are patches for it to work with cached pages.

As you have guessed there isn’t one answer to making a site load fast for any client that visits.
you can start though by visiting and also check out the links on that page to validate your site and fix the errors.

Also this site may give you hints to where to improve your site

Dear Ronald,

thanks for your input and links. As first steps I made images lighter, think this is always good. I checked different sites in the validator links, put nearly no site showed no problems, e.g.
sun: 32 Errors, 28 warning(s)
google: 42 Errors, 3 warning(s)
Implement all clean code does not seem to be easy.

The idea of a landing page is good. Will think about this. For the moment have to get things ready for production site.

fcgid has less load on apache than mod_php, after my first impressions, so I think I’ll stick with that. Will try to implement zlib and caching to further optimize.

Many thanks again for your help, and,

best regards,


An invaluable tool is firebug for firefox. It shows you how long each request takes (each image, each javascript, etc) in addition to many many other very useful features.

There are a few things that you can do to really speed up a site.

  1. use image sprites instead of individual images where applicable (google “image sprite” or “css sprite”). It takes a lot longer (and more system resources) to process 6 image requests than it does for just 1 (in addition the overall filesize of 1 image is smaller than 6), and you just use css and image offset to choose which image within your “image sprite” to view. This shouldn’t be done for all images (like a banner), but many you can and is best used where you have many images of the same dimensions (like menu backgrounds).

  2. use gzip compression on javascript/css/html using htaccess to serve if the browser is capable (safari isn’t). This can cut each file as much as 75% in size. Also pre compressing javascript using “YUI Compressor” is very beneficial (in addition to gzip).

  3. if you use a javascript framework, like jquery, mootools, dojo, etc., then use the Google AJAX API ( to host your framework code. One huge advantage to this (besides not using your bandwidth to serve the framework) is that if the user has previously been to a different website where the framework was served by google, then its already cached in the user browser and won’t be loaded again).

Hope some of these help.

I can NOT get any error messages to display in a browser configuring php.ini, I can get some errors to display with script includes but I get the server 500 error on simple errors. I tracked the process to the server error logs and found that the errors are in the logs but are not being passed to the browser?
While trouble shooting I found fcgid is handling running my php scripts so I figured to go back to mod_php and there I hit the wall.
How do I switch back to mod_php? I changed it in the virtualmin, it said it was now mod_php but when I created a new site it still used fcgid…

Without nuking my server and starting from scratch how do I get my errors to be passed to the browsers? How do I get rid of fcgid?

This is a private server with no users for programming only.
I’d switch back to my copy of Pro but I just found out my “license” expired.