[wp-trac] Re: [WordPress Trac] #4597: Change require to require_once for db.php

WordPress Trac wp-trac at lists.automattic.com
Mon Jul 9 12:59:27 GMT 2007


#4597: Change require to require_once for db.php
--------------------------------------------+-------------------------------
 Reporter:  intoxination                    |        Owner:  anonymous  
     Type:  defect                          |       Status:  new        
 Priority:  normal                          |    Milestone:  2.3 (trunk)
Component:  General                         |      Version:  2.2.1      
 Severity:  normal                          |   Resolution:             
 Keywords:  has-patch wp-settings database  |  
--------------------------------------------+-------------------------------
Comment (by intoxination):

 Sure - (it has been a nightmare). We have 2 sites running on a 8 core
 XServer OSX with Apache 2.2.4 and PHP 5.2.3 W/Eaccelerator. We are also
 using the HyperDB class. At very random times, the site would start giving
 blank pages. No error, no return header, no nothing. It happened to
 different users on different browsers and different pags (ie: the front
 page would be fine. The single post page would be fine in IE7, but in FF
 it would not show, until you clear the cookies out for commenting - no
 login cookies. In Opera it would give a connection refused).

 I ended up installing WP 2.2.1 on a new sub-domain on the machine and left
 everything at default. It wouldn't act up. After a couple of days, I added
 HyperDB back in. Problem pops-up.

 Thinking it was something with HyperDB, I replicated everything on my home
 Ubuntu box (including updating PHP and Apache to the same versions plus
 adding Eaccelerator). Everything continued to work fine. I even simulated
 load using siege along with AB. Still fine.

 Finally we turned off EAccelerator on the main server. We then started
 getting "can not redeclare class WPDB" errors every couple of hundred hits
 or so (we are talking one site that does 300,000+ page views a day and
 another that averages close to 100,000 page views a day so these errors
 popped up every 5 -15 minutes or so). These would also appear on various
 pages (and even on /wp-admin/index.php and once on wp-cron.php).

 Back to my test box. I killed Eaccelerator, ran back through thousands of
 hits with siege and AB simulating commenting, reading different pages,
 etc. The error never happened.

 I changed the require to require_once and so far it has been running 36
 hours with no problem.

 So it appears to be something happening in OSx running PHP 5.2.3. I know
 they had similar problems in 5.2.2 that were supposed to be fixed in
 5.2.3. It looks like a bug still got through. I want to do more testing
 and nail it down more to make sure of this. It sucks that it happens so
 randomly. I would install XDebug and trace everything, but since there can
 be a couple thousand hits before the problem, it would be a nightmare to
 find as well as a huge hit on the hard drive hehe.

 I know the description is long, but not nearly as long as the past 2 weeks
 have been trying to find this LOL.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4597#comment:2>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list