Author |
|
Sunburst
Joined: 09 Mar 2012 Posts: 20
|
Posted: Wed 28 Mar '12 12:55 Post subject: Apache 2.4 mod_fcgid: can't run |
|
|
Hi all
I hope for your support
I am on a Windows Apache 2.4, 32 bit version, downloaded from this site.
My Apache runs stabil for ½-1 day and it goes down by filling up the log with this error:
Code: | [Wed Mar 28 10:57:25.702325 2012] [fcgid:error] [pid 7328:tid 384] (OS 998)Invalid access to memory location. : mod_fcgid: can't run C:/Storage/Webserver/Apache1/PHP/php-5.4.0-nts-Win32-VC9-x86/php-cgi.exe
[Wed Mar 28 10:57:25.702325 2012] [fcgid:warn] [pid 7328:tid 384] (OS 998)Invalid access to memory location. : mod_fcgid: spawn process C:/Storage/Webserver/Apache1/PHP/php-5.4.0-nts-Win32-VC9-x86/php-cgi.exe error |
My FCGID settings are:
Code: | LoadModule fcgid_module modules/mod_fcgid.so
<IfModule mod_fcgid.c>
AddHandler fcgid-script .php
# Where to look for the php.ini file?
FcgidInitialEnv PHPRC "C:/Storage/Webserver/Apache1/PHP/php-5.4.0-nts-Win32-VC9-x86/php-5.4.0-nts-Win32-VC9-x86"
# Set PHP_FCGI_MAX_REQUESTS to greater than or equal to FcgidMaxRequestsPerProcess to prevent php-cgi process from exiting before all requests completed
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 10000
# Maximum requests a process should handle before it is terminated
FcgidMaxRequestsPerProcess 10000
FcgidMinProcessesPerClass 3
# Maximum number of PHP processes
FcgidMaxProcesses 1000
FcgidMaxProcessesPerClass 250
# Number of seconds of idle time before a php-cgi process is terminated
FcgidIOTimeout 120
FcgidIdleTimeout 300
# If the size of the request body exceeds this amount, the request will fail with 500 Server Error. Set to 1 GB.
FcgidMaxRequestLen 1048576000
# Path to php-cgi
FcgidWrapper "C:/Storage/Webserver/Apache1/PHP/php-5.4.0-nts-Win32-VC9-x86/php-cgi.exe" .php
# Define the MIME-Type for ".php" files
AddType application/x-httpd-php .php
</IfModule> |
The server is a dedicated server with 8 cpu cores, 32 GB RAM, only hosting apache and MySQL. I have 50 sites on the server, some of the have heavy trafic sometimes.
I made a script that restarts apache automatisilly when apache goes down, but I very much like you guys to comment on the problem. I am NOT an expert on fastcgi, so please help
Thank you
Kind regards,
Jens |
|
Back to top |
|
Sunburst
Joined: 09 Mar 2012 Posts: 20
|
Posted: Thu 29 Mar '12 14:05 Post subject: |
|
|
anyone? |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Thu 29 Mar '12 14:23 Post subject: |
|
|
No hurry.
Your config has some weird entries, where did you get it ?
Wondering why you have an AddType at the bottom while there is an Addhandler at the top of your config.
This one I do not understand: FcgidInitialEnv PHPRC "C:/Storage/Webserver/Apache1/PHP/php-5.4.0-nts-Win32-VC9-x86/php-5.4.0-nts-Win32-VC9-x86" (two times php-5.4.0-nts-Win32-VC9-x86.
First try it with with the recommended config in the ReadMe:
FcgidInitialEnv PHPRC "c:/php"
FcgidInitialEnv PATH "c:/php;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
FcgidInitialEnv SystemRoot "C:/Windows"
FcgidInitialEnv SystemDrive "C:"
FcgidInitialEnv TEMP "C:/WINDOWS/Temp"
FcgidInitialEnv TMP "C:/WINDOWS/Temp"
FcgidInitialEnv windir "C:/WINDOWS"
FcgidIOTimeout 64
FcgidConnectTimeout 16
FcgidMaxRequestsPerProcess 500
<Files ~ "\.php$>"
AddHandler fcgid-script .php
FcgidWrapper "c:/php/php-cgi.exe" .php
</Files>
Remember to substitute the c:/php for your actual path to PHP in the above example, eg in your case C:/Storage/Webserver/Apache1/PHP/php-5.4.0-nts-Win32-VC9-x86
Steffen
Last edited by Steffen on Thu 29 Mar '12 19:04; edited 1 time in total |
|
Back to top |
|
Sunburst
Joined: 09 Mar 2012 Posts: 20
|
Posted: Thu 29 Mar '12 17:02 Post subject: |
|
|
Hi Steffen
Thank you
I found the example on the web, but I replaced it with your example. It ran much quicker and without problems for some hours until it showed this error for all websites:
Code: | Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data. |
I have never seen this error before. And there was nothing to see in the log. When I restarted Apache it ran again.
Can you cast some light over it? Is the default example that you gave not fit for a server with many hits? I have 50 sites on the server and some of the sites have 1.000 - 3.000 unique visitors per day.
The server has 8 cpu cores, 32 RAM and 4 HHDs (raid10) and 2 SSDs (raid1 hosting the MySQL databases). So the hardware should not be the problem
Can you help again
Thank you so much |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Thu 29 Mar '12 19:06 Post subject: |
|
|
Doubt that this is a Apache config issue.
Really nothing in the Apache logs or in the Windows Event Viewer ?
Only happens with Chrome ?
See the very long discussion at http://groups.google.com/a/googleproductforums.com/forum/m/#!topic/chrome/E9OS9mS6yc8
Check your antivirus, firewall or shield settings. and check for for malware. Also clear the browser cash and try and disable Chrome extensions.
The extra settings we have here:
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000
FcgidMaxRequestsPerProcess 1000
FcgidMaxProcesses 50
FcgidMaxRequestLen 8131072
And that has quite more visitors then yours.
Steffen |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 29 Mar '12 21:09 Post subject: |
|
|
Where did you get this error
Quote: |
Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.
|
in your browser?
Do you have a gigabit networkcard in that server? Is it running wiwth gigabit?
--- edit ---
Like Steffen I think it is Chrome related, not Apache |
|
Back to top |
|
Sunburst
Joined: 09 Mar 2012 Posts: 20
|
Posted: Thu 29 Mar '12 22:05 Post subject: |
|
|
Yes it happened in my browsers (Chrome and Firefox) and yes the server is on a 1 gbit internet connection.
I changed the settings to give the fastcgi more speed as Stefen wrote and have not seen the error since.
What can the error be? |
|
Back to top |
|
Sunburst
Joined: 09 Mar 2012 Posts: 20
|
|
Back to top |
|
Sunburst
Joined: 09 Mar 2012 Posts: 20
|
Posted: Tue 03 Apr '12 9:50 Post subject: |
|
|
The error is back:
Code: | [Tue Apr 03 09:10:59.958229 2012] [fcgid:error] [pid 5444:tid 396] (OS 998)Invalid access to memory location. : mod_fcgid: can't run C:/Storage/Webserver/Apache1/PHP/php-5.4.0-nts-Win32-VC9-x86/php-cgi.exe
[Tue Apr 03 09:10:59.958229 2012] [fcgid:warn] [pid 5444:tid 396] (OS 998)Invalid access to memory location. : mod_fcgid: spawn process C:/Storage/Webserver/Apache1/PHP/php-5.4.0-nts-Win32-VC9-x86/php-cgi.exe error |
The error happens 2 times each day and apache finally - after filling up the log - goes down (but it restarted automatically).
Under Server-Status (when the error happened and before the restart) it showed zero fastcgi processes.
I think I better downgrade now - both Apache and PHP... :-/
UPDATE: PHP is now downgraded to 5.3.10. And if the error keeps poping up I will downgrade to Apache 2.2 too. |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Tue 03 Apr '12 18:53 Post subject: |
|
|
Is there some indication in your php.log ?
Steffen |
|
Back to top |
|
Sunburst
Joined: 09 Mar 2012 Posts: 20
|
Posted: Thu 19 Apr '12 8:41 Post subject: |
|
|
Thank you for your fine replies
I got it to work by:
1) Disabling the new Apache 2.4 disk cache. It was actuall slowing things down.
2) Running with the example configuration mod_fcgid
3) Setting MaxConnectionsPerChild down to 50000 in mpm_winnt_modul
So now it is 100% stable running for some weeks
But now I found this gigantic security hole in my settings - please help me here: http://www.apachelounge.com/viewtopic.php?t=4683 |
|
Back to top |
|