ZF-11414: Upgrade to PHP 5.3 causes fatal errors

Issue Type: Bug Created: 2011-05-27T14:58:21.000+0000 Last Updated: 2011-05-30T18:27:43.000+0000 Status: Open Fix version(s): Reporter: Giles Birch (gbirch) Assignee: Ralph Schindler (ralph) Tags: - Zend_Db_Adapter_Mysqli

  • 5.3
  • PHP

Related issues: Attachments:


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)


Posted by Adam Lundrigan (adamlundrigan) on 2011-05-30T16:01:03.000+0000

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.

Posted by Giles Birch (gbirch) on 2011-05-30T18:16:36.000+0000

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.

Posted by Giles Birch (gbirch) on 2011-05-30T18:17:30.000+0000

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

Posted by Giles Birch (gbirch) on 2011-05-30T18:27:43.000+0000

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.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.