Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

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

2 Answers 2

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.

share|improve this answer
    
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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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