From: jan dot gaensler at gmx dot de
Operating system: Linux (kernel 2.4)
PHP version: 4.3.9
PHP Bug Type: Zend Engine 2 problem
Bug description: require_once fails sporadically on classes
Description:
------------
After upgrading PHP 4.3.4 to 4.3.9 on our production
system we experienced a random problem on our servers
using 'require_once'. In about 1% of the cases calling
'require_once' on a file defining a class produced a fatal
error like this one:
[Tue Oct 19 18:04:07 2004] [error] PHP Fatal error:
Cannot redeclare class globalresources
in /srv/www/htdocs/lx/includes/initialisator.inc on line
111
The scripts run just fine using PHP 4.3.4 but any more
recent version of PHP4 produces the above problem (I
actually tried them all: 4.3.5/6/7/8/9).
More info on the server setup as this might help: Dell
PE2650, Dual P4Xeon, 2GB running Suse Linux 9.0, Apache
1.3.31 and PHP as a module (the apache servers are using
multiple VirtualHosts each listening on a different port)
PHP was compiled using the following options:
'./configure' '--with-apxs' '--enable-track-vars=yes'
'--with-mysql' '--enable-sysvshm' '--enable-sysvsem'
'--enable-url-fopen-wrapper=yes' '--enable-sockets'
'--enable-force-cgi-redirect' '--enable-trans-sid'
'--with-xml' '--with-gd' '--with-ttf' '--with-curl'
'--with-zlib-dir' '--with-mime-magic'
Reproduce code:
---------------
As stated above this works at least 99% of the time:
global $resources; //line 110
require_once('lib/GlobalResources.php'); //line 111
$resources = new GlobalResources(); //line 112
(These three lines are taken from the above mentioned include that is
itself included by all scripts creating a complete HTML page)
Expected result:
----------------
N/A
Actual result:
--------------
N/A
--
Edit bug report at http://bugs.php.net/?id=30493&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30493&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30493&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30493&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30493&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30493&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30493&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30493&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30493&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30493&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30493&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=30493&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=30493&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30493&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30493&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30493&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30493&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30493&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30493&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30493&r=mysqlcfg