Problem with PHP and new installed server

Hi I have had Virtullmin for many years on my SuSe server, but since SuSe is suppurtgrade N I wanted to try Centos, that is supposed to be a Grade A OS

I install I server from scratch (Centos 5.4 X-64)

Install Virtualmin with the script do a yum update. restore all my servers from a backup (from my other server) and then Apache is DEAD http-events give this error:

[crit] Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP.

I never had this error on SuSE



What PHP execution mode are you using? Are any of your sites using mod_php, or do they use CGI/FCGID?

On Virtualmin Pro, the default is CGI/FCGID (and that can also be configured on Virtualmin GPL).

If you aren't using mod_php, you could simply disable mod_php in Apache, which would resolve that error you're seeing.

Dont know which execution mode Apache is using, I just installed centos 5.4 and then run the virtualmin

but I cant find that mod_php is loaded in any of the config files for apache...

but Im new to Centos, Im just testing it out to find out if I should replace SuSE since I've been told that its supposed to be better with virtulamin....

Is that a Virtualmin Pro or GPL install?

If it's Pro, if you look in System Settings -> Server Templates -> Apache Website -> Default PHP Execution Mode, what is that set to?

Hmm... what's the output of these two commands:

rpm -qa | grep httpd

rpm -qa | grep php


php-5.1.6-23.2.el5_3 php-devel-5.1.6-23.2.el5_3 php-snmp-5.1.6-23.2.el5_3 php-pdo-5.1.6-23.2.el5_3 php-mysql-5.1.6-23.2.el5_3 php-mbstring-5.1.6-23.2.el5_3 php-common-5.1.6-23.2.el5_3 php-cli-5.1.6-23.2.el5_3 php-imap-5.1.6-23.2.el5_3 php-xmlrpc-5.1.6-23.2.el5_3 php-odbc-5.1.6-23.2.el5_3 php-pear-1.4.9-6.el5 wbm-php-pear-1.5-1 php-pgsql-5.1.6-23.2.el5_3 php-gd-5.1.6-23.2.el5_3

It sounds like Apache somehow was set to use the MPM worker mode (which isn't the default).

The packages you have all look correct, so I'm trying to figure out how to change that back to pre-fork mode on CentOS -- I'll let you know as soon as I figure that out :-)

Aha -- what are the contents of this file: /etc/sysconfig/httpd

Normally, the HTTPD variable in there is commented out -- but I'm guessing yours isn't?

If not, try commenting it out, and then restarting Apache with:

/etc/init.d/httpd restart

it say :


but it was working with 2 test domains, before I did yum update

I did a yum update and then I restored the domains... then it didn't work anymore....

I'll try to take away all the domins that was imported, se if ther eare somthing in the directives for the servers that are strange...

My recommendation is to just comment out that value (by putting a # in front of it), and to restart Apache. The threaded mode of Apache can't work with mod_php, which is what is happening.

Perhaps that occurred during some system updates, or during a restore of a Virtual Server, I'm not sure -- but rather than redoing all your settings, a long-term fix is to just comment that out and use pre-fork mode.

Or, if you wanted to use suexec, you could setup FastCGI or CGI along with suexec, but one step at a time :-)

It said "#" infront..... this board makes the comment sign to make it big fonts....

also tried to delete som of the domains I restored, and now it's working again

then I only need to find out which domain that makes it crash...

any Idea for what to look for in the config files?

how do I set up fastcgi with suexec? ? in GPL

and thanks for all help so far :)

Merry christmas

Well, isn't that strange. If you can narrow it down to which one is causing the issue, we may be able to show that to Jamie, and get him to lend a hand in preventing this in the future :-)

Regarding suexec and fastcgi -- there's a sticky thread here that covers how to set that up on Virtualmin GPL:

think I found the error,

there is a file in my backup directory called virtualmin.tar.gz I guess that it contains some of the settings from my old server.

I dont know what's in this file, I can upload it if you or Jamie want to have a look at it

when this file wasn't availeble the restore worked nice and webserver was still up and running after restore.

and a little question that maybe belongs in a different forum: I noticed after restoring was that on centos The apache "default webserver" is working (from apache directives) and not like it was on suse, where I had to make a -default domain (to be first in the list) to show up in case someone did a request to the IP adress or a non excisting domain, is this a centos feature or has Apache evolved