ZF-11414: Upgrade to PHP 5.3 causes fatal errors


Upgraded server from PHP 5.2.17 to 5.3.6 on CENTOS 5.6 x86_64, MySQL 5.0.92, Apache 2.2 MPM Event 1. Script sets $db = new Zend_Db_Adapter_Mysqli($dbDSN); 2. A function runs a series of simple queries, all work fine and produce suitable results: $sportsemploy = $db->fetchCol('SELECT id FROM employment WHERE sports'); $nsportsemploy = $db->fetchCol('SELECT id FROM employment WHERE NOT sports'); $bactivity = $db->fetchCol('SELECT id FROM special_interest WHERE race="B"'); $wactivity = $db->fetchCol('SELECT id FROM special_interest WHERE race="W"');

  1. Function enters a loop, and the following code results in 500 errors from the server, which I presume to be PHP fatal errors (I can't catch them): for ($i = 1; $i <= $numprofiles; $i++) { $this->profiles[$i]['race'] = $race = $db->fetchOne('SELECT race FROM name WHERE id = ?', array($this->profiles[$i]['name'])); $this->profiles[$i]['gender'] = $gender = $db->fetchOne('SELECT gender FROM name WHERE id = ?', array($this->profiles[$i]['name'])); $this->profiles[$i]['sports'] = $sports = $db->fetchOne('SELECT sports FROM leadership WHERE id = ?', array($this->profiles[$i]['leadership'])); //... }

  2. It's not a problem with the loop or the variables therein. The same error occurs if I replace the for loop with another query against $db, ANY other query.

  3. All code works just peachy under PHP 5.2.17 (both before upgrade, and after downgrade)


Do you get any error messages in the Apache log? Is error display enabled in your PHP? If not, you may want to try turning it on and visiting the page again to see if PHP is raising any errors.

Can't find any errors in the Apache log (which may, I admit, be because it's improperly configured). Yes, error reporting is enabled ("error_reporting(-1);"), and no, I get no PHP errors--just the crash and the re-direct to 500.shtml.

Sorry, that strikeout was unintentional--should read error_reporting(-1);

Some additional/clarifying information in case it is helpful: 1. If I terminate the function before the loop, no error. 2. Same behavior occurs whether or not profiler is enabled. 3. Querying the profiler and returning before the loop does not cause errors (and shows no problems with preceding queries). 4. When I say that "ANY other query" causes a crash, I mean that it crashes even if I simply repeat one of the queries in step 2 before returning.