Memcache fast-cgi php apache 2.2 windows 7 creating problems

apache-2.2fastcgimemcachedwindows 7

I am trying to run memcache, fast-cgi with apache 2.2 + php on a windows 7 machine. If I don't use memcache everything works fine.

The moment I disable extension=php_memcache.dll in php.ini everything returns to normal.

Once I start apache, the apache logs say:

[Wed Jan 12 18:19:23 2011] [notice] Apache/2.2.17 (Win32) mod_fcgid/2.3.6 configured -- resuming normal operations
[Wed Jan 12 18:19:23 2011] [notice] Server built: Oct 18 2010 01:58:12
[Wed Jan 12 18:19:23 2011] [notice] Parent: Created child process 412
[Wed Jan 12 18:19:23 2011] [notice] Child 412: Child process is running
[Wed Jan 12 18:19:23 2011] [notice] Child 412: Acquired the start mutex.
[Wed Jan 12 18:19:23 2011] [notice] Child 412: Starting 64 worker threads.
[Wed Jan 12 18:19:23 2011] [notice] Child 412: Starting thread to listen on port 80.

and after accessing the page (the page just has echo phpinfo()) I get this error in the error.log:

[Wed Jan 12 18:20:54 2011] [warn] [client 127.0.0.1] (OS 109)The pipe has been ended.  : mod_fcgid: get overlap result error
[Wed Jan 12 18:20:54 2011] [error] [client 127.0.0.1] Premature end of script headers: index.php

I have php_memcache.dll in my ext directory and httpd.conf is like this:

LoadModule fcgid_module modules/mod_fcgid.so

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 32
FcgidMaxRequestsPerProcess 500

<Files ~ "\.php$>"
  AddHandler fcgid-script .php
  FcgidWrapper "c:/php/php-cgi.exe" .php
</Files>

So the problem has to be related to memcache because if I disable it, fast-cgi seems to be working fine. Are there any possible reasons for this??

The memcache service is running… I can check it through control panel->services.

Best Answer

Run PHP manually (find php.exe and double click it). What often happens is that PHP can't load the extension for some reason, and tries to pop up message box telling you this. Since noone's around to see the message box when it runs as a service, no one knows what is going on.