I programmed the site using:
- Zend Framework 1.11.5 (full MVC)
- PHP 5.3.6
- Apache 2.2.19
- CentOS 5.6 i686 virtuozzo on vps
- cPanel WHM 11.30.1 (build 4)
- Mysql 5.1.56-log
- Mysqli API 5.1.56
Suddenly making a few βSHOW CREATE TABLEβ queries to mysql, I got this.
[Wed Jul 20 17:35:23 2011 ] [notice] EACCELERATOR(5827): PHP crashed on opline 138 of fetch_fields() at /usr/lib/php/Zend/Db/Statement/Mysqli.php:235
I tried disabling eaccelerator without success
[Wed Jul 20 17:45:34 2011] [warn] [client 190.78.208.30] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server [Wed Jul 20 17:45:34 2011] [error] [client 190.78.208.30] Premature end of script headers: index.php [Wed Jul 20 17:45:34 2011] [error] mod_fcgid: process /usr/local/cpanel/cgi-sys/php5(11562) exit(communication error), get unexpected signal 11 [Wed Jul 20 17:45:34 2011] [warn] [client 190.78.208.30] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server [Wed Jul 20 17:45:34 2011] [error] [client 190.78.208.30] Premature end of script headers: index.php
The problem line is this: $ row = $ db-> fetchRow ("SHOW CREATE TABLE 222AFI") ;. If I return before it is completed, everything will be fine. $ db is an instance of Zend_Db_Adapter_Mysqli. Worst of all, what is not deterministic. A program may run several times, and some may not. Usually it does NOT skip a line without php crashes.
<?php class Admin_DbController extends Controller_BaseController { public function updateSqlDefinitionsAction() { $db = Zend_Registry::get('db'); $row = $db->fetchRow("SHOW CREATE TABLE 222AFI"); } } ?>
I did not write to internals@lists.php.net because I do not have https://bugs.php.net/bugs-generating-backtrace.php . This might be silly, but I tried recompiling apache with "--enable-debug" (this is a production server). However, βPHP Apache Module: Run httpd -X and enter the script that PHP crashes.β Is the part I'm not working. The server tells me that port 80 is already in use.
Can anyone give me some advice? If I am doing something crazy, at least some other options?
I can try recompiling apache at midnight, but it would be great to know that I won't break anything. As you can see, this is very important to me.
EDIT
I need to compile php with --enable-debug. This is strange, this is not a failure, as is usually the case. This is difficult, out of 20 attempts, perhaps one failure. And if you run apache with -X, it is even harder to get php to fail because httpd has been reacting for too long.
EDIT2
Even if it after 20 attempts, I can make it crash if I started httpd without the -X flag. However, I emulated a script that initializes the $ _SERVER variables to make Zend assume that it is being called through the browser. When I execute this script with "php crash.php" many times (e.g. 50), everything goes fine. I am starting to believe that this has something to do with php reusable processes. I run apache with mod_fcgi and:
Server version: Apache/2.2.19 (Unix) Server built: Jul 20 2011 19:18:58 Cpanel::Easy::Apache v3.4.2 rev9999 Server Module Magic Number: 20051115:28 Server loaded: APR 1.4.5, APR-Util 1.3.12 Compiled using: APR 1.4.5, APR-Util 1.3.12 Architecture: 32-bit Server MPM: Prefork threaded: no forked: yes (variable process count) Server compiled with.... -D APACHE_MPM_DIR="server/mpm/prefork" -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled) -D APR_USE_SYSVSEM_SERIALIZE -D APR_USE_PTHREAD_SERIALIZE -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D DYNAMIC_MODULE_LIMIT=128 -D HTTPD_ROOT="/usr/local/apache" -D SUEXEC_BIN="/usr/local/apache/bin/suexec" -D DEFAULT_PIDLOG="logs/httpd.pid" -D DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D DEFAULT_LOCKFILE="logs/accept.lock" -D DEFAULT_ERRORLOG="logs/error_log" -D AP_TYPES_CONFIG_FILE="conf/mime.types" -D SERVER_CONFIG_FILE="conf/httpd.conf"