When doing restore got message about mod_php

15 posts / 0 new
Last post
#1 Thu, 09/09/2010 - 01:23

When doing restore got message about mod_php

When doing a restore from our old server to new I got a message stating:

"Checking restored PHP execution mode .. .. mode Apache mod_php cannot be used, switching to FCGId."

I know the basics of mod_php and FCGId but what does that message mean and why did I get it ?

Thu, 09/09/2010 - 09:03


Are you getting that on all the domains you restore, or just some of them?

Were they in fact using mod_php?

If so, is mod_php installed and enabled in your new server?


Thu, 09/09/2010 - 21:19 (Reply to #2)

Looks like all of them. I don't know if they were using mod_php or not...I never configured how PHP was handled. I'm also not yet sure if it is installed. It is a fresh install of Centos 5 x64...plus Virtualmin GPL

Fri, 09/10/2010 - 04:05

Well I migrated a bunch of sites to a new server and I'm getting all sorts of problems. I can't get PHP to work - I get a Forbidden message whenever I try to access them. Any ideas?

Fri, 09/10/2010 - 08:43

What error are you seeing in the Apache error logs for the domain when you try to access it?

You can view that in $HOME/logs/error_log.


Fri, 09/10/2010 - 18:42

Here is what most of the errors are showing:

This is an error related to a server side include that calls a php file: [Fri Sep 10 18:33:43 2010] [error] [client xx.xx.xx.xx] unable to include "/scripts/xxx.php" in parsed file /home/xxx/public_html/xxx.htm, referer: http://xxxxxxxxxxxxxxxxxxx

When I try to go to a web page that is generated using php I get a direct forbidden message and no errors in the http error log. The php scripts simply aren't being run.

I'm guessing this is related to FastCGI vs php_mod... I see some related issues online about it. Researching further.

Fri, 09/10/2010 - 18:48

Also I ran a php info and "mod_php5" is one of the loaded modules. I seen nothing for FastCGI

Fri, 09/10/2010 - 18:55

Ok fixed it. I went into Virtualmin under Server Configuration -> Website Options and changed "PHP script execution mode" from FCGId to CGI wrapper..

So yeah the import hosed this part for some reason... Why would it do that?

Also, with my config which is better FCGId or CGI wrapper?

Dual CPU 8 core Zeon #1.86ghz & 12GB RAM

There isn't a ton of real-time dynamic hosting going on. Mostly static pages.

Fri, 09/10/2010 - 19:21


Yeah, I suspect you'll be just fine using CGI in your case.

Even with FCGID and dynamic websites, many users can't tell the difference between it and CGI.

But with static pages, if CGI is what's working for you -- I think that'll work just fine!


Sat, 09/18/2010 - 11:07

Thanks. Is there a difference between CGI and mod_php ? Is there an easy way to enable each of these for a specific or all websites on the server? I'd like to experiment with each of them as I am having some scripts that seem to be running slower than before, while others seem to be running faster than before... Not sure if it is PHP, MySQL, cache settings, or something else...

Tue, 09/28/2010 - 02:21

Any answer on the last post? It seems eAccelerator does not support php-cgi. My previous sites were mod_php but Virtualmin did not migrate them properly. I suspect this is a function of how PHP is compiled? I don't know.

How would I got about converting my php-cgi sites to mod_php ?


Tue, 09/28/2010 - 09:54

You can change between CGI, FCGID, and mod_php for your various sites by going into Server Configuration -> Website Options, and setting "PHP script execution mode".


Tue, 09/28/2010 - 11:57

CGI wrapper and FCGId are the only options.

Wed, 09/29/2010 - 03:16

ok I painstakingly compared backups of my old httpd.conf file to the new one and made changes.

Before: Using phpinfo() the site is running in CGI/FCGId mode...

I basically had to remove these lines to make it run under mod_php.

Action application/x-httpd-php5 /cgi-bin/php5.cgi AddType application/x-httpd-php5 .php5 AddType application/x-httpd-php5 .php

RemoveHandler .php RemoveHandler .php5

After: Once those were removed I verified using phpinfo() that the site is now using mod_php.

eAccelerator now runs. Sites are now MUCH faster.

Finally in Virtualmin under 'Website Options' there are only two options for 'PHP script execution mode': CGI wrapper and FCGId. Neither of these options are now selected. If Virtualmin is supposed to support mod_php it isn't in my fresh install and even broke my sites when migrating/restoring... Is this a bug ?

Tue, 10/12/2010 - 23:49

IT seems to be a bug to me...

Old server with 350 site... some FCGI some CGI Wrapper some mod_php

Everyone was imported as fcgi.. What a mess .. Had to remove them all and now I looking to the answers to why it didn't export/import correctly..

Don Peek

Topic locked