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] (OS 109)The pipe has been ended.  : mod_fcgid: get overlap result error
[Wed Jan 12 18:20:54 2011] [error] [client] 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

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.

  • FYI, you don't echo phpinfo();, you can just call phpinfo(); :-) – Josh Jan 13 '11 at 16:06

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.

  • when i try to run it with double click. i get this error: The procedure entry point gc_remove_zval_from_buffer could not be located in the dynamic link library php5ts.dll .. a quick google dint reveal anything.. also if i comme the extension=php_memcache.dll .. the error doesnt occur – Ahmad Jan 13 '11 at 6:01
  • here is the message that appears in the command prompt window: PHP warning: php startup: unable to load dynamic link library 'c:\php\ext\php_memcache.dll' - the specified procedure could not be found – Ahmad Jan 13 '11 at 6:13

I got it working. The problem was with the version of dll and php version. I upgraded php to 5.3 and it's ok now.

You must also be careful about the thread safe and non-thread safe version... any incompatibility will not let you run memcache.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.