logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache is running a threaded MPM, but your PHP Module ....
Author
rosponius



Joined: 07 Jul 2008
Posts: 9

PostPosted: Mon 07 Jul '08 16:27    Post subject: Apache is running a threaded MPM, but your PHP Module .... Reply with quote

I Have installed apache on win xp, and it worked. Then I installed a not thread safe compiled php 5.25. After configuring httpd on apache I get this error and apache server cannot start anymore:

"Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP.
Pre-configuration failed"

I need a not thread safe php so I cannot recompile it of course!
How can I make apache work with a nts php?
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Mon 07 Jul '08 19:08    Post subject: Reply with quote

Maybe you can use mod_fcgid module.

Steffen
Back to top
rosponius



Joined: 07 Jul 2008
Posts: 9

PostPosted: Mon 07 Jul '08 22:59    Post subject: Reply with quote

okay thank you
I tried to search for this and other modules on apache website but I only found a description of the modules, none download. Can these modules be downloaded? How to install them? Confused
Back to top
rosponius



Joined: 07 Jul 2008
Posts: 9

PostPosted: Mon 07 Jul '08 23:16    Post subject: Reply with quote

I found the module. But it is a tar file with a folder inside and a lot of files not just one; I read the install instruction (below) but I can't figure out what should I do and which of the many files I should copy!

1. copy mod_fcgid to httpd-2.X.X/modules/
2. cd httpd-2.X.X/modules/mod_fcgid/
3. nmake -f Makefile.nt
4. copy mod_fcgid.so to $Apache_install_path/modules
5. add the following line in httpd.con

and what is mpm_winnt_module and how can I install that?
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Tue 08 Jul '08 7:29    Post subject: Reply with quote

Windows binary of mod_fcgid is at www.apachelounge.com/download/

Steffen
Back to top
rosponius



Joined: 07 Jul 2008
Posts: 9

PostPosted: Tue 08 Jul '08 13:10    Post subject: Reply with quote

I downloaded it and followed the instruction to install; but still have the same problem!
Also tried to change the php using the windows installer as suggested at fcgid homepage, but without positive result.
Also tried to configure fast_cgi as suggested.
Where am I wrong?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Tue 08 Jul '08 15:12    Post subject: Reply with quote

I was able to run PHP NTS as fast cgi and PHP as module.

I tested only for one folder outside my normal doc root.

Code:

PHPIniDir "D:/server2/php"
LoadModule php5_module "D:/server2/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps


LoadModule fcgid_module modules/mod_fcgid.so
<IfModule mod_fcgid.c>

   IPCCommTimeout 40
   IPCConnectTimeout 10
   MaxProcessCount 8
   OutputBufferSize 64
   ProcessLifeTime 60
   MaxRequestsPerProcess 500
   
   Alias /php-nts/ "D:/server2/fcgi/"
   <Directory D:/server2/fcgi/>
      AddHandler fcgid-script .php
      Options Indexes FollowSymLinks ExecCGI
      FCGIWrapper "D:/server2/php-nts/php-cgi.exe" .php
      AllowOverride all
      Order allow,deny
      Allow from all
      Satisfy any
   </Directory>

</IfModule>


So in my folder php-nts I had php as non thread safe version.
Back to top
rosponius



Joined: 07 Jul 2008
Posts: 9

PostPosted: Tue 08 Jul '08 18:50    Post subject: Reply with quote

What is the folder fcgi in the below line? What's in there? I'm using fcgid_mod non fcgi

<Directory D:/server2/fcgi/>

How does php installed as cgi work, what's difference, isn't it possible to install nts-php as cgi only instead of installing it as a module? (I can't find a guide for windows about this!)
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Tue 08 Jul '08 20:49    Post subject: Reply with quote

Of you can remove my part from the module and replace the path in the Directory with your doc root.

Code:

LoadModule fcgid_module modules/mod_fcgid.so
<IfModule mod_fcgid.c>

   IPCCommTimeout 40
   IPCConnectTimeout 10
   MaxProcessCount 8
   OutputBufferSize 64
   ProcessLifeTime 60
   MaxRequestsPerProcess 500

   SetEnv PHPRC "c:/php-nts"
   # this shoud be where your php.ini is
   

   <Directory C:/path/to/your/docroot/>
      AddHandler fcgid-script .php
      Options Indexes FollowSymLinks ExecCGI
      FCGIWrapper "c:/php-nts/php-cgi.exe" .php
      AllowOverride all
      Order allow,deny
      Allow from all
      Satisfy any
   </Directory>

</IfModule>


not tested yet, but that should work.
Back to top
rosponius



Joined: 07 Jul 2008
Posts: 9

PostPosted: Wed 09 Jul '08 13:31    Post subject: Reply with quote

Thanks for your help Smile
Anyway I tried to follow all the steps you suggested but I still got the same problem: Apache don't start!
I'll tell you what I did:
1. I installed apache trough the win32 installer. I testes it worked localhost.
2. I installed a Thread safe 5.2.6 php in C:/php I moved the php5ts.dll in C:/windows. I added to httpd.conf the lines to load php as module I restarted apache, created a php info file. Everything worked both apache and php.
3. Added a folder nts-php in C:/php, added the lines below to httpd.conf and copied the fcgid module to apache modules folder

Code:

LoadModule fcgid_module modules/mod_fcgid.so
<IfModule mod_fcgid.c>

   IPCCommTimeout 40
   IPCConnectTimeout 10
   MaxProcessCount 8
   OutputBufferSize 64
   ProcessLifeTime 60
   MaxRequestsPerProcess 500

   SetEnv PHPRC "c:/php/php-nts"
   # this shoud be where your php.ini is
   

   <Directory C:/Programmi/Apache Software Foundation/Apache2.2/htdocs>
      AddHandler fcgid-script .php
      Options Indexes FollowSymLinks ExecCGI
      FCGIWrapper "c:/php/php-nts/php-cgi.exe" .php
      AllowOverride all
      Order allow,deny
      Allow from all
      Satisfy any
   </Directory>

</IfModule>


This is what I found in the error log:
Code:
[Wed Jul 09 01:48:43 2008] [notice] Child 2152: Exit event signaled. Child process is ending.
httpd.exe: Syntax error on line 132 of C:/Programmi/Apache Software Foundation/Apache2.2/conf/httpd.conf: Cannot load C:/Programmi/Apache Software Foundation/Apache2.2/modules/mod_fcgid.so into server: Impossibile trovare il modulo specificato. 
[Wed Jul 09 01:48:43 2008] [warn] (OS 995)Operazione di I/O terminata a causa dell'uscita dal thread oppure della richiesta di un'applicazione.  : winnt_accept: Asynchronous AcceptEx failed.
[Wed Jul 09 01:48:44 2008] [notice] Child 2152: Released the start mutex
[Wed Jul 09 01:48:46 2008] [notice] Child 2152: All worker threads have exited.
[Wed Jul 09 01:48:46 2008] [notice] Child 2152: Child process is exiting


This is my line 132 in httpd.conf:
Code:
LoadModule fcgid_module modules/mod_fcgid.so


I had already installed the Visual C++ 2008 Redistributable Package

Neutral
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Wed 09 Jul '08 22:12    Post subject: Reply with quote

Quote:

innt_accept: Asynchronous AcceptEx failed


At first add Win32DisableAcceptEx to your httpd.conf
For more details see http://httpd.apache.org/docs/2.2/mod/mpm_winnt.html
Back to top
rosponius



Joined: 07 Jul 2008
Posts: 9

PostPosted: Wed 09 Jul '08 22:54    Post subject: Reply with quote

I added "Win32DisableAcceptEx" like below to httpd, is this the correct method to add a directive?
I think I did something wrong because I still get the same error
I also tried to write that directive on top of httpd but no change.
Also uncommented EnableMMAP off and EnableSendfile off (as suggested by a google search) but with no result

Code:
<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
Win32DisableAcceptEx
</IfModule>
Back to top
rosponius



Joined: 07 Jul 2008
Posts: 9

PostPosted: Fri 11 Jul '08 21:17    Post subject: Reply with quote

Hallo, James please could you just tell me if I added the directive correctly?
thanks Smile
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Fri 11 Jul '08 22:36    Post subject: Reply with quote

Just put it at the very end of your httpd.conf
Do not use ifmodule before or after it.
Back to top
rosponius



Joined: 07 Jul 2008
Posts: 9

PostPosted: Sat 12 Jul '08 0:42    Post subject: Reply with quote

I tried, it doesn't work!
Back to top


Reply to topic   Topic: Apache is running a threaded MPM, but your PHP Module .... View previous topic :: View next topic
Post new topic   Forum Index -> Apache