php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30493 require_once fails sporadically on classes
Submitted: 2004-10-20 12:43 UTC Modified: 2005-03-22 14:48 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: jan dot gaensler at gmx dot de Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.3.9 OS: Linux (kernel 2.4)
Private report: No CVE-ID: None
 [2004-10-20 12:43 UTC] jan dot gaensler at gmx dot de
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 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-27 15:53 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.


 [2004-12-04 14:37 UTC] jan dot gaensler at gmx dot de
The whole script plus files included by it is way too 
much to include here (1000+ lines) - I'll try to provide 
a cut down version of the script ASAP, but still this 
may take a couple of days.
 [2005-01-13 01:13 UTC] tony2001@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2005-03-22 14:39 UTC] jan dot gaensler at gmx dot de
Sorry for the long delay - finally we did a further test and saw that disabling the ZendPerformanceSuite (Version 4.0.0) made the problem disappear. Looks like an issue Zend will have to deal with, but thanks for having a look at this anyway...
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Sep 18 20:01:27 2024 UTC