Hello, I am actually working on a PHP extension module writen in C and I have a problem I cannot resolve for weeks : it runs perfectly when PHP is configured as a CGI script but not when PHP is an Apache module (httpd is no more responding after a few requests).
Configuration: OS: Linux 2.4.20-8 Redhat 9 Server: Apache 2 configured with mpm=prefork PHP: 4.3.2 or 4.3.3 or PHP 5 (same problem) Module presentation: Developped in C, the module.so is placed in the /usr/local/lib/php/extensions/no-debug-non-zts-20020429/ directory All the PHP scripts begin with: dl('module.so'); I also tried to add extension=module.so in the php.ini file and remove the dl instruction : same problem Problem description: If PHP is compiled with '--enable-force-cgi-redirect' and is a CGI script, everything is ok If PHP is compiled with '--with-apxs2=/usr/local/apache2/bin/apxs' and is an Apache module, only a few requests are ok (the first one and sometime one more). When attempting another request, the httpd is not responding and the logs in my application show me that it stopped processing during execution of my program. If I changed the C program, it will stop at another point as if something was wrong in the memory and the problem could appear at any moment... I have read and read the PHP manual to find out information.... I though about a lot of possibilities : -problem with C global variable handling (I am not using ZTS), -problem with Zend variables handling (the C functions are creating and updating zval parameters) -problem with sessions (I tried files and mm with same result) -bad configuration... I could give more information if needed. Anyway, I thank you for the time you will spend reading this email. Pascal