#18590 [Com]: Fatal error: Cannot redeclare upon reload

2010-01-28 Thread krajicek at centrum dot sk
 ID:   18590
 Comment by:   krajicek at centrum dot sk
 Reported By:  armageddon at raydan dot de
 Status:   No Feedback
 Bug Type: Scripting Engine problem
 Operating System: WinXP Pro
 PHP Version:  5.0.0-dev
 New Comment:

...adding some more comments to my above.

here is the simplest sample i've created:

redeclare_issue_main.php:
-

-


redeclare_issue_test.inc.php:
-

-

running the redeclare_issue_main.php code after any change (e.g. add
blank line) to redeclare_issue_test.inc.php will bring up:

Fatal error: Cannot redeclare sendmail1() in
redeclare_issue_test.inc.php on line 2

upon browser reload the error is gone.
cannot confirm my previous assumption that also change in PHP related
server config cause that the error reappears.

OS: FreeBSD 6.3-STABLE-20080418.1500
Apache 2.0 Handler (20051115)
PHP Version 5.2.12


Previous Comments:


[2010-01-28 09:27:38] krajicek at centrum dot sk

confirming the same (similar) issue - if file with function definition
is included twice (via include) in the script run it throws Fatal Error
- Cannot redeclare functionXY. on reload the Fatal Error is gone. on any
change to script or PHP related server config is error back again. fix
for the error message is to use include_once instead of include.
but this can cause problems by not displaying error messages all the
times.

OS: FreeBSD 6.3-STABLE-20080418.1500
Apache 2.0 Handler (20051115)
PHP Version 5.2.12



[2009-02-04 20:44:55] greg at pwsdb dot com

Tenative Conclusion: php has already loaded and defined everything. 
pear should not be re-loading or re-defining anything. 
this is the conflict.   
[the possibility of any exception(s) is the source of the conflict]



[2009-02-04 17:31:51] greg at pwsdb dot com

system notes:
zencart Version 1.3.8a
Server OS: Linux 2.6.18-53.1.14.el5.centos.plus
HTTP Server: Apache/2.2.3 (CentOS)
PHP Version: 5.1.6 (Zend: 2.1.0)



[2009-02-04 17:22:29] greg at pwsdb dot com

PPS 
  I now remember a few months ago I added code to a pgm I had written 
to access another $_POST variable. I also moved the call to my program
(in  includes/modules/pages/checkout_confirmation/header_php.php) down
past some error checking.  I immediately started getting "Fatal
error:"
messages about things being defined twice throughout many (untouched)
zc pgms.:
i 'undid' things but could not stop it until I had changed all the 
require()  calls to  require_once() 

Fatal error: Cannot redeclare class order in
/.../includes/classes/order.php on line 1018
Fatal error: Cannot redeclare class shipping in
/.../includes/classes/shipping.php on line 178
Fatal error: Cannot redeclare class order_total in
/.../includes/classes/order_total.php on line 232
Fatal error: Cannot redeclare class payment in
/.../includes/classes/payment.php on line 255
Fatal error: Cannot redeclare class cc_validation in
/.../includes/classes/cc_validation.php on line 184
and more. 

again, it has to be "php vs. pear" (?) 
this was in  "PHP Version 5.1.6".  From the comments above, it must 
still be in  Ver. 5.2.4



[2009-02-04 05:22:00] greg at pwsdb dot com

PPS
no, it is not working in the login page now, either.
Same experience as the others above?:  
"First it works, then it doesn't."



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/18590

-- 
Edit this bug report at http://bugs.php.net/?id=18590&edit=1



#18590 [Com]: Fatal error: Cannot redeclare upon reload

2010-01-28 Thread krajicek at centrum dot sk
 ID:   18590
 Comment by:   krajicek at centrum dot sk
 Reported By:  armageddon at raydan dot de
 Status:   No Feedback
 Bug Type: Scripting Engine problem
 Operating System: WinXP Pro
 PHP Version:  5.0.0-dev
 New Comment:

confirming the same (similar) issue - if file with function definition
is included twice (via include) in the script run it throws Fatal Error
- Cannot redeclare functionXY. on reload the Fatal Error is gone. on any
change to script or PHP related server config is error back again. fix
for the error message is to use include_once instead of include.
but this can cause problems by not displaying error messages all the
times.

OS: FreeBSD 6.3-STABLE-20080418.1500
Apache 2.0 Handler (20051115)
PHP Version 5.2.12


Previous Comments:


[2009-02-04 20:44:55] greg at pwsdb dot com

Tenative Conclusion: php has already loaded and defined everything. 
pear should not be re-loading or re-defining anything. 
this is the conflict.   
[the possibility of any exception(s) is the source of the conflict]



[2009-02-04 17:31:51] greg at pwsdb dot com

system notes:
zencart Version 1.3.8a
Server OS: Linux 2.6.18-53.1.14.el5.centos.plus
HTTP Server: Apache/2.2.3 (CentOS)
PHP Version: 5.1.6 (Zend: 2.1.0)



[2009-02-04 17:22:29] greg at pwsdb dot com

PPS 
  I now remember a few months ago I added code to a pgm I had written 
to access another $_POST variable. I also moved the call to my program
(in  includes/modules/pages/checkout_confirmation/header_php.php) down
past some error checking.  I immediately started getting "Fatal
error:"
messages about things being defined twice throughout many (untouched)
zc pgms.:
i 'undid' things but could not stop it until I had changed all the 
require()  calls to  require_once() 

Fatal error: Cannot redeclare class order in
/.../includes/classes/order.php on line 1018
Fatal error: Cannot redeclare class shipping in
/.../includes/classes/shipping.php on line 178
Fatal error: Cannot redeclare class order_total in
/.../includes/classes/order_total.php on line 232
Fatal error: Cannot redeclare class payment in
/.../includes/classes/payment.php on line 255
Fatal error: Cannot redeclare class cc_validation in
/.../includes/classes/cc_validation.php on line 184
and more. 

again, it has to be "php vs. pear" (?) 
this was in  "PHP Version 5.1.6".  From the comments above, it must 
still be in  Ver. 5.2.4



[2009-02-04 05:22:00] greg at pwsdb dot com

PPS
no, it is not working in the login page now, either.
Same experience as the others above?:  
"First it works, then it doesn't."



[2009-02-04 03:46:35] greg at pwsdb dot com

PS
This only happened within a checkout page of ZenCart ("part 3 of 3")  
and not another (not the login page) ... I don't know enough about zc
to know what the significant difference is.



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/18590

-- 
Edit this bug report at http://bugs.php.net/?id=18590&edit=1



#18590 [Com]: Fatal error: Cannot redeclare upon reload

2009-02-04 Thread greg at pwsdb dot com
 ID:   18590
 Comment by:   greg at pwsdb dot com
 Reported By:  armageddon at raydan dot de
 Status:   No Feedback
 Bug Type: Scripting Engine problem
 Operating System: WinXP Pro
 PHP Version:  5.0.0-dev
 New Comment:

Tenative Conclusion: php has already loaded and defined everything. 
pear should not be re-loading or re-defining anything. 
this is the conflict.   
[the possibility of any exception(s) is the source of the conflict]


Previous Comments:


[2009-02-04 17:31:51] greg at pwsdb dot com

system notes:
zencart Version 1.3.8a
Server OS: Linux 2.6.18-53.1.14.el5.centos.plus
HTTP Server: Apache/2.2.3 (CentOS)
PHP Version: 5.1.6 (Zend: 2.1.0)



[2009-02-04 17:22:29] greg at pwsdb dot com

PPS 
  I now remember a few months ago I added code to a pgm I had written 
to access another $_POST variable. I also moved the call to my program
(in  includes/modules/pages/checkout_confirmation/header_php.php) down
past some error checking.  I immediately started getting "Fatal
error:"
messages about things being defined twice throughout many (untouched)
zc pgms.:
i 'undid' things but could not stop it until I had changed all the 
require()  calls to  require_once() 

Fatal error: Cannot redeclare class order in
/.../includes/classes/order.php on line 1018
Fatal error: Cannot redeclare class shipping in
/.../includes/classes/shipping.php on line 178
Fatal error: Cannot redeclare class order_total in
/.../includes/classes/order_total.php on line 232
Fatal error: Cannot redeclare class payment in
/.../includes/classes/payment.php on line 255
Fatal error: Cannot redeclare class cc_validation in
/.../includes/classes/cc_validation.php on line 184
and more. 

again, it has to be "php vs. pear" (?) 
this was in  "PHP Version 5.1.6".  From the comments above, it must 
still be in  Ver. 5.2.4



[2009-02-04 05:22:00] greg at pwsdb dot com

PPS
no, it is not working in the login page now, either.
Same experience as the others above?:  
"First it works, then it doesn't."



[2009-02-04 03:46:35] greg at pwsdb dot com

PS
This only happened within a checkout page of ZenCart ("part 3 of 3")  
and not another (not the login page) ... I don't know enough about zc
to know what the significant difference is.



[2009-02-04 02:59:23] greg at pwsdb dot com

this experience/test may help:

I defined a function (fff) in the top of my pgm. (not in a loop)
it spanned from line 5 to 11 and used it in the code below.  
I got this error msg:


Fatal error: Cannot redeclare fff() (previously declared in 
/.../xxx.php:5) in 
/.../xxx.php on line 11


I then removed it to an external file (xx-functions.php) and did a 
"require_once() for xxx-functions.php on line 6  and got these 2 
error messages where there should have only been one. 
IT WAS TRYING TO LOAD THE FUNCTION(PGM) TWICE: 


Warning: require_once(xxx-functions.php) [function.require-once]: 
failed to open stream: No such file or directory in 
/.../xxx.php on line 6

Fatal error: require_once() [function.require]: Failed opening required

'xxx-functions.php' (include_path='.:/usr/share/pear') in 
/.../xxx.php on line 6



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/18590

-- 
Edit this bug report at http://bugs.php.net/?id=18590&edit=1



#18590 [Com]: Fatal error: Cannot redeclare upon reload

2009-02-04 Thread greg at pwsdb dot com
 ID:   18590
 Comment by:   greg at pwsdb dot com
 Reported By:  armageddon at raydan dot de
 Status:   No Feedback
 Bug Type: Scripting Engine problem
 Operating System: WinXP Pro
 PHP Version:  5.0.0-dev
 New Comment:

system notes:
zencart Version 1.3.8a
Server OS: Linux 2.6.18-53.1.14.el5.centos.plus
HTTP Server: Apache/2.2.3 (CentOS)
PHP Version: 5.1.6 (Zend: 2.1.0)


Previous Comments:


[2009-02-04 17:22:29] greg at pwsdb dot com

PPS 
  I now remember a few months ago I added code to a pgm I had written 
to access another $_POST variable. I also moved the call to my program
(in  includes/modules/pages/checkout_confirmation/header_php.php) down
past some error checking.  I immediately started getting "Fatal
error:"
messages about things being defined twice throughout many (untouched)
zc pgms.:
i 'undid' things but could not stop it until I had changed all the 
require()  calls to  require_once() 

Fatal error: Cannot redeclare class order in
/.../includes/classes/order.php on line 1018
Fatal error: Cannot redeclare class shipping in
/.../includes/classes/shipping.php on line 178
Fatal error: Cannot redeclare class order_total in
/.../includes/classes/order_total.php on line 232
Fatal error: Cannot redeclare class payment in
/.../includes/classes/payment.php on line 255
Fatal error: Cannot redeclare class cc_validation in
/.../includes/classes/cc_validation.php on line 184
and more. 

again, it has to be "php vs. pear" (?) 
this was in  "PHP Version 5.1.6".  From the comments above, it must 
still be in  Ver. 5.2.4



[2009-02-04 05:22:00] greg at pwsdb dot com

PPS
no, it is not working in the login page now, either.
Same experience as the others above?:  
"First it works, then it doesn't."



[2009-02-04 03:46:35] greg at pwsdb dot com

PS
This only happened within a checkout page of ZenCart ("part 3 of 3")  
and not another (not the login page) ... I don't know enough about zc
to know what the significant difference is.



[2009-02-04 02:59:23] greg at pwsdb dot com

this experience/test may help:

I defined a function (fff) in the top of my pgm. (not in a loop)
it spanned from line 5 to 11 and used it in the code below.  
I got this error msg:


Fatal error: Cannot redeclare fff() (previously declared in 
/.../xxx.php:5) in 
/.../xxx.php on line 11


I then removed it to an external file (xx-functions.php) and did a 
"require_once() for xxx-functions.php on line 6  and got these 2 
error messages where there should have only been one. 
IT WAS TRYING TO LOAD THE FUNCTION(PGM) TWICE: 


Warning: require_once(xxx-functions.php) [function.require-once]: 
failed to open stream: No such file or directory in 
/.../xxx.php on line 6

Fatal error: require_once() [function.require]: Failed opening required

'xxx-functions.php' (include_path='.:/usr/share/pear') in 
/.../xxx.php on line 6



[2008-05-30 13:48:47] mark dot php dot net dot special at emceesoftware
dot com

As a followup to my last comment, the way this "error" is being
reported proved a little confusing, and my warrant some minor research
in order to help make it a bit easier to identify when it happens.

My error log reports the following (abbreviated):

PHP Fatal error:  Cannot redeclare simplehtml_rendercontent()
(previously declared in SimpleHTML.php:149) in SimpleHTML.php on line
152

Noteworthy is the fact that the RenderContent() method is declared on
line 149.  The closing brace for the method is on line 152.

It was this difference in line numbers that proved the most confusing. 
If they both reported out at line 149, I suspect I would have more
quickly determined that I was seeing a reload problem of some sort.

Also, if after adjusting the line number being reported, it is
determined that they are identical, it might be helpful to post an
additional line in the error log which suggests the developer look at
replacing an include() with include_once() or require() with
require_once().

With that bit of reporting, I suspect most folks who get bit with this
type of issue will be able to resolve it more quickly (whether
dynamically as I've done, or at the top of a PHP file).



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/18590

-- 
Edit this bug report at http://bugs.php.net/?id=18590&edit=1



#18590 [Com]: Fatal error: Cannot redeclare upon reload

2009-02-04 Thread greg at pwsdb dot com
 ID:   18590
 Comment by:   greg at pwsdb dot com
 Reported By:  armageddon at raydan dot de
 Status:   No Feedback
 Bug Type: Scripting Engine problem
 Operating System: WinXP Pro
 PHP Version:  5.0.0-dev
 New Comment:

PPS 
  I now remember a few months ago I added code to a pgm I had written 
to access another $_POST variable. I also moved the call to my program
(in  includes/modules/pages/checkout_confirmation/header_php.php) down
past some error checking.  I immediately started getting "Fatal
error:"
messages about things being defined twice throughout many (untouched)
zc pgms.:
i 'undid' things but could not stop it until I had changed all the 
require()  calls to  require_once() 

Fatal error: Cannot redeclare class order in
/.../includes/classes/order.php on line 1018
Fatal error: Cannot redeclare class shipping in
/.../includes/classes/shipping.php on line 178
Fatal error: Cannot redeclare class order_total in
/.../includes/classes/order_total.php on line 232
Fatal error: Cannot redeclare class payment in
/.../includes/classes/payment.php on line 255
Fatal error: Cannot redeclare class cc_validation in
/.../includes/classes/cc_validation.php on line 184
and more. 

again, it has to be "php vs. pear" (?) 
this was in  "PHP Version 5.1.6".  From the comments above, it must 
still be in  Ver. 5.2.4


Previous Comments:


[2009-02-04 05:22:00] greg at pwsdb dot com

PPS
no, it is not working in the login page now, either.
Same experience as the others above?:  
"First it works, then it doesn't."



[2009-02-04 03:46:35] greg at pwsdb dot com

PS
This only happened within a checkout page of ZenCart ("part 3 of 3")  
and not another (not the login page) ... I don't know enough about zc
to know what the significant difference is.



[2009-02-04 02:59:23] greg at pwsdb dot com

this experience/test may help:

I defined a function (fff) in the top of my pgm. (not in a loop)
it spanned from line 5 to 11 and used it in the code below.  
I got this error msg:


Fatal error: Cannot redeclare fff() (previously declared in 
/.../xxx.php:5) in 
/.../xxx.php on line 11


I then removed it to an external file (xx-functions.php) and did a 
"require_once() for xxx-functions.php on line 6  and got these 2 
error messages where there should have only been one. 
IT WAS TRYING TO LOAD THE FUNCTION(PGM) TWICE: 


Warning: require_once(xxx-functions.php) [function.require-once]: 
failed to open stream: No such file or directory in 
/.../xxx.php on line 6

Fatal error: require_once() [function.require]: Failed opening required

'xxx-functions.php' (include_path='.:/usr/share/pear') in 
/.../xxx.php on line 6



[2008-05-30 13:48:47] mark dot php dot net dot special at emceesoftware
dot com

As a followup to my last comment, the way this "error" is being
reported proved a little confusing, and my warrant some minor research
in order to help make it a bit easier to identify when it happens.

My error log reports the following (abbreviated):

PHP Fatal error:  Cannot redeclare simplehtml_rendercontent()
(previously declared in SimpleHTML.php:149) in SimpleHTML.php on line
152

Noteworthy is the fact that the RenderContent() method is declared on
line 149.  The closing brace for the method is on line 152.

It was this difference in line numbers that proved the most confusing. 
If they both reported out at line 149, I suspect I would have more
quickly determined that I was seeing a reload problem of some sort.

Also, if after adjusting the line number being reported, it is
determined that they are identical, it might be helpful to post an
additional line in the error log which suggests the developer look at
replacing an include() with include_once() or require() with
require_once().

With that bit of reporting, I suspect most folks who get bit with this
type of issue will be able to resolve it more quickly (whether
dynamically as I've done, or at the top of a PHP file).



[2008-05-30 12:43:13] mark dot php dot net dot special at emceesoftware
dot com

PHP 5.2.4 (Build date 30 Aug 2007)

I experience this error while using a technique for dispatching method
calls dynamically.

On receipt of an XML packet, an API method determines the php module
(source file) that needs to be loaded to process the XML file.

Next, the method name is loaded into a variable, and the source file is
included.

Finally, the variable is used to call the method.

I've been successfully testing this approach for some time, and am
confused as to why it has started "now".

Code sample (abbreviated):

$moduleName = ... (extracted from XML structure)
$methodName = .

#18590 [Com]: Fatal error: Cannot redeclare upon reload

2009-02-03 Thread greg at pwsdb dot com
 ID:   18590
 Comment by:   greg at pwsdb dot com
 Reported By:  armageddon at raydan dot de
 Status:   No Feedback
 Bug Type: Scripting Engine problem
 Operating System: WinXP Pro
 PHP Version:  5.0.0-dev
 New Comment:

PPS
no, it is not working in the login page now, either.
Same experience as the others above?:  
"First it works, then it doesn't."


Previous Comments:


[2009-02-04 03:46:35] greg at pwsdb dot com

PS
This only happened within a checkout page of ZenCart ("part 3 of 3")  
and not another (not the login page) ... I don't know enough about zc
to know what the significant difference is.



[2009-02-04 02:59:23] greg at pwsdb dot com

this experience/test may help:

I defined a function (fff) in the top of my pgm. (not in a loop)
it spanned from line 5 to 11 and used it in the code below.  
I got this error msg:


Fatal error: Cannot redeclare fff() (previously declared in 
/.../xxx.php:5) in 
/.../xxx.php on line 11


I then removed it to an external file (xx-functions.php) and did a 
"require_once() for xxx-functions.php on line 6  and got these 2 
error messages where there should have only been one. 
IT WAS TRYING TO LOAD THE FUNCTION(PGM) TWICE: 


Warning: require_once(xxx-functions.php) [function.require-once]: 
failed to open stream: No such file or directory in 
/.../xxx.php on line 6

Fatal error: require_once() [function.require]: Failed opening required

'xxx-functions.php' (include_path='.:/usr/share/pear') in 
/.../xxx.php on line 6



[2008-05-30 13:48:47] mark dot php dot net dot special at emceesoftware
dot com

As a followup to my last comment, the way this "error" is being
reported proved a little confusing, and my warrant some minor research
in order to help make it a bit easier to identify when it happens.

My error log reports the following (abbreviated):

PHP Fatal error:  Cannot redeclare simplehtml_rendercontent()
(previously declared in SimpleHTML.php:149) in SimpleHTML.php on line
152

Noteworthy is the fact that the RenderContent() method is declared on
line 149.  The closing brace for the method is on line 152.

It was this difference in line numbers that proved the most confusing. 
If they both reported out at line 149, I suspect I would have more
quickly determined that I was seeing a reload problem of some sort.

Also, if after adjusting the line number being reported, it is
determined that they are identical, it might be helpful to post an
additional line in the error log which suggests the developer look at
replacing an include() with include_once() or require() with
require_once().

With that bit of reporting, I suspect most folks who get bit with this
type of issue will be able to resolve it more quickly (whether
dynamically as I've done, or at the top of a PHP file).



[2008-05-30 12:43:13] mark dot php dot net dot special at emceesoftware
dot com

PHP 5.2.4 (Build date 30 Aug 2007)

I experience this error while using a technique for dispatching method
calls dynamically.

On receipt of an XML packet, an API method determines the php module
(source file) that needs to be loaded to process the XML file.

Next, the method name is loaded into a variable, and the source file is
included.

Finally, the variable is used to call the method.

I've been successfully testing this approach for some time, and am
confused as to why it has started "now".

Code sample (abbreviated):

$moduleName = ... (extracted from XML structure)
$methodName = ... (derived from another parameter)
$sourceFile = $_SERVER["DOCUMENT_ROOT"].'/path/'.$moduleName.'.php';
include( $sourceFile );
$dynamicMethod = $moduleName.'_'.$methodName;
$dynamicMethod();  // attempt the call

My theory is that this code is being called multiple times with the
same value for $moduleName, causing the include() method to attempt to
load it multiple times.  While this doesn't seem to be an issue when
using the static 'include_once' declaration, it appears to be an issue
when loading dynamically.

When changing the above code to use include_once(), the problem seems
(so far) to have gone away.



[2007-09-03 13:52:58] info at rchu dot nl

update: adding a space to the source results in the same 'cannot
redeclare' error. Only changing the function name resolves the problem
at the fist run. Must be some kind of caching problem I suppose. When
running the script on the command line there is no problem, just when I
request in in my browser. I run the pre-installed apache1.3 on Mac OS X
10.4.10 and used the --with-apache-hooks option on compiling because I
do not have the apache.h source file (since I haven't compiled apac

#18590 [Com]: Fatal error: Cannot redeclare upon reload

2009-02-03 Thread greg at pwsdb dot com
 ID:   18590
 Comment by:   greg at pwsdb dot com
 Reported By:  armageddon at raydan dot de
 Status:   No Feedback
 Bug Type: Scripting Engine problem
 Operating System: WinXP Pro
 PHP Version:  5.0.0-dev
 New Comment:

PS
This only happened within a checkout page of ZenCart ("part 3 of 3")  
and not another (not the login page) ... I don't know enough about zc
to know what the significant difference is.


Previous Comments:


[2009-02-04 02:59:23] greg at pwsdb dot com

this experience/test may help:

I defined a function (fff) in the top of my pgm. (not in a loop)
it spanned from line 5 to 11 and used it in the code below.  
I got this error msg:


Fatal error: Cannot redeclare fff() (previously declared in 
/.../xxx.php:5) in 
/.../xxx.php on line 11


I then removed it to an external file (xx-functions.php) and did a 
"require_once() for xxx-functions.php on line 6  and got these 2 
error messages where there should have only been one. 
IT WAS TRYING TO LOAD THE FUNCTION(PGM) TWICE: 


Warning: require_once(xxx-functions.php) [function.require-once]: 
failed to open stream: No such file or directory in 
/.../xxx.php on line 6

Fatal error: require_once() [function.require]: Failed opening required

'xxx-functions.php' (include_path='.:/usr/share/pear') in 
/.../xxx.php on line 6



[2008-05-30 13:48:47] mark dot php dot net dot special at emceesoftware
dot com

As a followup to my last comment, the way this "error" is being
reported proved a little confusing, and my warrant some minor research
in order to help make it a bit easier to identify when it happens.

My error log reports the following (abbreviated):

PHP Fatal error:  Cannot redeclare simplehtml_rendercontent()
(previously declared in SimpleHTML.php:149) in SimpleHTML.php on line
152

Noteworthy is the fact that the RenderContent() method is declared on
line 149.  The closing brace for the method is on line 152.

It was this difference in line numbers that proved the most confusing. 
If they both reported out at line 149, I suspect I would have more
quickly determined that I was seeing a reload problem of some sort.

Also, if after adjusting the line number being reported, it is
determined that they are identical, it might be helpful to post an
additional line in the error log which suggests the developer look at
replacing an include() with include_once() or require() with
require_once().

With that bit of reporting, I suspect most folks who get bit with this
type of issue will be able to resolve it more quickly (whether
dynamically as I've done, or at the top of a PHP file).



[2008-05-30 12:43:13] mark dot php dot net dot special at emceesoftware
dot com

PHP 5.2.4 (Build date 30 Aug 2007)

I experience this error while using a technique for dispatching method
calls dynamically.

On receipt of an XML packet, an API method determines the php module
(source file) that needs to be loaded to process the XML file.

Next, the method name is loaded into a variable, and the source file is
included.

Finally, the variable is used to call the method.

I've been successfully testing this approach for some time, and am
confused as to why it has started "now".

Code sample (abbreviated):

$moduleName = ... (extracted from XML structure)
$methodName = ... (derived from another parameter)
$sourceFile = $_SERVER["DOCUMENT_ROOT"].'/path/'.$moduleName.'.php';
include( $sourceFile );
$dynamicMethod = $moduleName.'_'.$methodName;
$dynamicMethod();  // attempt the call

My theory is that this code is being called multiple times with the
same value for $moduleName, causing the include() method to attempt to
load it multiple times.  While this doesn't seem to be an issue when
using the static 'include_once' declaration, it appears to be an issue
when loading dynamically.

When changing the above code to use include_once(), the problem seems
(so far) to have gone away.



[2007-09-03 13:52:58] info at rchu dot nl

update: adding a space to the source results in the same 'cannot
redeclare' error. Only changing the function name resolves the problem
at the fist run. Must be some kind of caching problem I suppose. When
running the script on the command line there is no problem, just when I
request in in my browser. I run the pre-installed apache1.3 on Mac OS X
10.4.10 and used the --with-apache-hooks option on compiling because I
do not have the apache.h source file (since I haven't compiled apache).



[2007-09-03 13:48:09] info at rchu dot nl

I have sort of the same bug I think.

test.php


works fine the first time. Then after a reload it gives an cannot
redeclare test

#18590 [Com]: Fatal error: Cannot redeclare upon reload

2009-02-03 Thread greg at pwsdb dot com
 ID:   18590
 Comment by:   greg at pwsdb dot com
 Reported By:  armageddon at raydan dot de
 Status:   No Feedback
 Bug Type: Scripting Engine problem
 Operating System: WinXP Pro
 PHP Version:  5.0.0-dev
 New Comment:

this experience/test may help:

I defined a function (fff) in the top of my pgm. (not in a loop)
it spanned from line 5 to 11 and used it in the code below.  
I got this error msg:


Fatal error: Cannot redeclare fff() (previously declared in 
/.../xxx.php:5) in 
/.../xxx.php on line 11


I then removed it to an external file (xx-functions.php) and did a 
"require_once() for xxx-functions.php on line 6  and got these 2 
error messages where there should have only been one. 
IT WAS TRYING TO LOAD THE FUNCTION(PGM) TWICE: 


Warning: require_once(xxx-functions.php) [function.require-once]: 
failed to open stream: No such file or directory in 
/.../xxx.php on line 6

Fatal error: require_once() [function.require]: Failed opening required

'xxx-functions.php' (include_path='.:/usr/share/pear') in 
/.../xxx.php on line 6


Previous Comments:


[2008-05-30 13:48:47] mark dot php dot net dot special at emceesoftware
dot com

As a followup to my last comment, the way this "error" is being
reported proved a little confusing, and my warrant some minor research
in order to help make it a bit easier to identify when it happens.

My error log reports the following (abbreviated):

PHP Fatal error:  Cannot redeclare simplehtml_rendercontent()
(previously declared in SimpleHTML.php:149) in SimpleHTML.php on line
152

Noteworthy is the fact that the RenderContent() method is declared on
line 149.  The closing brace for the method is on line 152.

It was this difference in line numbers that proved the most confusing. 
If they both reported out at line 149, I suspect I would have more
quickly determined that I was seeing a reload problem of some sort.

Also, if after adjusting the line number being reported, it is
determined that they are identical, it might be helpful to post an
additional line in the error log which suggests the developer look at
replacing an include() with include_once() or require() with
require_once().

With that bit of reporting, I suspect most folks who get bit with this
type of issue will be able to resolve it more quickly (whether
dynamically as I've done, or at the top of a PHP file).



[2008-05-30 12:43:13] mark dot php dot net dot special at emceesoftware
dot com

PHP 5.2.4 (Build date 30 Aug 2007)

I experience this error while using a technique for dispatching method
calls dynamically.

On receipt of an XML packet, an API method determines the php module
(source file) that needs to be loaded to process the XML file.

Next, the method name is loaded into a variable, and the source file is
included.

Finally, the variable is used to call the method.

I've been successfully testing this approach for some time, and am
confused as to why it has started "now".

Code sample (abbreviated):

$moduleName = ... (extracted from XML structure)
$methodName = ... (derived from another parameter)
$sourceFile = $_SERVER["DOCUMENT_ROOT"].'/path/'.$moduleName.'.php';
include( $sourceFile );
$dynamicMethod = $moduleName.'_'.$methodName;
$dynamicMethod();  // attempt the call

My theory is that this code is being called multiple times with the
same value for $moduleName, causing the include() method to attempt to
load it multiple times.  While this doesn't seem to be an issue when
using the static 'include_once' declaration, it appears to be an issue
when loading dynamically.

When changing the above code to use include_once(), the problem seems
(so far) to have gone away.



[2007-09-03 13:52:58] info at rchu dot nl

update: adding a space to the source results in the same 'cannot
redeclare' error. Only changing the function name resolves the problem
at the fist run. Must be some kind of caching problem I suppose. When
running the script on the command line there is no problem, just when I
request in in my browser. I run the pre-installed apache1.3 on Mac OS X
10.4.10 and used the --with-apache-hooks option on compiling because I
do not have the apache.h source file (since I haven't compiled apache).



[2007-09-03 13:48:09] info at rchu dot nl

I have sort of the same bug I think.

test.php


works fine the first time. Then after a reload it gives an cannot
redeclare test() error. Same error after second reload etc. Modify the
file (add a space or something like that) and it runs OK the first time
but after reload same error.

I have compiled PHP 5.2.4 on Darwin Kernel Version 8.10.2.



[2004-03-31 09:

#18590 [Com]: Fatal error: Cannot redeclare upon reload

2008-05-30 Thread mark dot php dot net dot special at emceesoftware dot com
 ID:   18590
 Comment by:   mark dot php dot net dot special at emceesoftware dot
   com
 Reported By:  armageddon at raydan dot de
 Status:   No Feedback
 Bug Type: Scripting Engine problem
 Operating System: WinXP Pro
 PHP Version:  5.0.0-dev
 New Comment:

As a followup to my last comment, the way this "error" is being
reported proved a little confusing, and my warrant some minor research
in order to help make it a bit easier to identify when it happens.

My error log reports the following (abbreviated):

PHP Fatal error:  Cannot redeclare simplehtml_rendercontent()
(previously declared in SimpleHTML.php:149) in SimpleHTML.php on line
152

Noteworthy is the fact that the RenderContent() method is declared on
line 149.  The closing brace for the method is on line 152.

It was this difference in line numbers that proved the most confusing. 
If they both reported out at line 149, I suspect I would have more
quickly determined that I was seeing a reload problem of some sort.

Also, if after adjusting the line number being reported, it is
determined that they are identical, it might be helpful to post an
additional line in the error log which suggests the developer look at
replacing an include() with include_once() or require() with
require_once().

With that bit of reporting, I suspect most folks who get bit with this
type of issue will be able to resolve it more quickly (whether
dynamically as I've done, or at the top of a PHP file).


Previous Comments:


[2008-05-30 12:43:13] mark dot php dot net dot special at emceesoftware
dot com

PHP 5.2.4 (Build date 30 Aug 2007)

I experience this error while using a technique for dispatching method
calls dynamically.

On receipt of an XML packet, an API method determines the php module
(source file) that needs to be loaded to process the XML file.

Next, the method name is loaded into a variable, and the source file is
included.

Finally, the variable is used to call the method.

I've been successfully testing this approach for some time, and am
confused as to why it has started "now".

Code sample (abbreviated):

$moduleName = ... (extracted from XML structure)
$methodName = ... (derived from another parameter)
$sourceFile = $_SERVER["DOCUMENT_ROOT"].'/path/'.$moduleName.'.php';
include( $sourceFile );
$dynamicMethod = $moduleName.'_'.$methodName;
$dynamicMethod();  // attempt the call

My theory is that this code is being called multiple times with the
same value for $moduleName, causing the include() method to attempt to
load it multiple times.  While this doesn't seem to be an issue when
using the static 'include_once' declaration, it appears to be an issue
when loading dynamically.

When changing the above code to use include_once(), the problem seems
(so far) to have gone away.



[2007-09-03 13:52:58] info at rchu dot nl

update: adding a space to the source results in the same 'cannot
redeclare' error. Only changing the function name resolves the problem
at the fist run. Must be some kind of caching problem I suppose. When
running the script on the command line there is no problem, just when I
request in in my browser. I run the pre-installed apache1.3 on Mac OS X
10.4.10 and used the --with-apache-hooks option on compiling because I
do not have the apache.h source file (since I haven't compiled apache).



[2007-09-03 13:48:09] info at rchu dot nl

I have sort of the same bug I think.

test.php


works fine the first time. Then after a reload it gives an cannot
redeclare test() error. Same error after second reload etc. Modify the
file (add a space or something like that) and it runs OK the first time
but after reload same error.

I have compiled PHP 5.2.4 on Darwin Kernel Version 8.10.2.



[2004-03-31 09:57:54] christian dot lefebvre at atosorigin dot com

I got it !
Seems that when a function is declared in an included file,
after a top level "return", it's detected as already defined


example with «t1.php» :


and «t2.php» :


with cli sapi of php5 RC1 or with today snapshot, here is
the output :
inc t2
in t2
still in t2
end of t2
Here am I !!
re-inc t2

Fatal error: Cannot redeclare toto() (previously declared in
.../t2.php:13) in .../t2.php on line 14

  note that even the "in t2" log is not displayed at
second include.



[2004-03-31 09:38:46] christian dot lefebvre at atosorigin dot com

I got the same problem with RC1 version under
Linux/apache2filter
  I just tried with snapshot 200403311230 (same config)
and the message disappear but the tested code still crashes.
  As the same code works with php4.3.4, I think this ticket
should be re

#18590 [Com]: Fatal error: Cannot redeclare upon reload

2008-05-30 Thread mark dot php dot net dot special at emceesoftware dot com
 ID:   18590
 Comment by:   mark dot php dot net dot special at emceesoftware dot
   com
 Reported By:  armageddon at raydan dot de
 Status:   No Feedback
 Bug Type: Scripting Engine problem
 Operating System: WinXP Pro
 PHP Version:  5.0.0-dev
 New Comment:

PHP 5.2.4 (Build date 30 Aug 2007)

I experience this error while using a technique for dispatching method
calls dynamically.

On receipt of an XML packet, an API method determines the php module
(source file) that needs to be loaded to process the XML file.

Next, the method name is loaded into a variable, and the source file is
included.

Finally, the variable is used to call the method.

I've been successfully testing this approach for some time, and am
confused as to why it has started "now".

Code sample (abbreviated):

$moduleName = ... (extracted from XML structure)
$methodName = ... (derived from another parameter)
$sourceFile = $_SERVER["DOCUMENT_ROOT"].'/path/'.$moduleName.'.php';
include( $sourceFile );
$dynamicMethod = $moduleName.'_'.$methodName;
$dynamicMethod();  // attempt the call

My theory is that this code is being called multiple times with the
same value for $moduleName, causing the include() method to attempt to
load it multiple times.  While this doesn't seem to be an issue when
using the static 'include_once' declaration, it appears to be an issue
when loading dynamically.

When changing the above code to use include_once(), the problem seems
(so far) to have gone away.


Previous Comments:


[2007-09-03 13:52:58] info at rchu dot nl

update: adding a space to the source results in the same 'cannot
redeclare' error. Only changing the function name resolves the problem
at the fist run. Must be some kind of caching problem I suppose. When
running the script on the command line there is no problem, just when I
request in in my browser. I run the pre-installed apache1.3 on Mac OS X
10.4.10 and used the --with-apache-hooks option on compiling because I
do not have the apache.h source file (since I haven't compiled apache).



[2007-09-03 13:48:09] info at rchu dot nl

I have sort of the same bug I think.

test.php


works fine the first time. Then after a reload it gives an cannot
redeclare test() error. Same error after second reload etc. Modify the
file (add a space or something like that) and it runs OK the first time
but after reload same error.

I have compiled PHP 5.2.4 on Darwin Kernel Version 8.10.2.



[2004-03-31 09:57:54] christian dot lefebvre at atosorigin dot com

I got it !
Seems that when a function is declared in an included file,
after a top level "return", it's detected as already defined


example with «t1.php» :


and «t2.php» :


with cli sapi of php5 RC1 or with today snapshot, here is
the output :
inc t2
in t2
still in t2
end of t2
Here am I !!
re-inc t2

Fatal error: Cannot redeclare toto() (previously declared in
.../t2.php:13) in .../t2.php on line 14

  note that even the "in t2" log is not displayed at
second include.



[2004-03-31 09:38:46] christian dot lefebvre at atosorigin dot com

I got the same problem with RC1 version under
Linux/apache2filter
  I just tried with snapshot 200403311230 (same config)
and the message disappear but the tested code still crashes.
  As the same code works with php4.3.4, I think this ticket
should be reopened.

  I'll try to make a smaller test case



[2003-12-04 02:24:54] [EMAIL PROTECTED]

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.





The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/18590

-- 
Edit this bug report at http://bugs.php.net/?id=18590&edit=1



#18590 [Com]: Fatal error: Cannot redeclare upon reload

2007-09-03 Thread info at rchu dot nl
 ID:   18590
 Comment by:   info at rchu dot nl
 Reported By:  armageddon at raydan dot de
 Status:   No Feedback
 Bug Type: Scripting Engine problem
 Operating System: WinXP Pro
 PHP Version:  5.0.0-dev
 New Comment:

update: adding a space to the source results in the same 'cannot
redeclare' error. Only changing the function name resolves the problem
at the fist run. Must be some kind of caching problem I suppose. When
running the script on the command line there is no problem, just when I
request in in my browser. I run the pre-installed apache1.3 on Mac OS X
10.4.10 and used the --with-apache-hooks option on compiling because I
do not have the apache.h source file (since I haven't compiled apache).


Previous Comments:


[2007-09-03 13:48:09] info at rchu dot nl

I have sort of the same bug I think.

test.php


works fine the first time. Then after a reload it gives an cannot
redeclare test() error. Same error after second reload etc. Modify the
file (add a space or something like that) and it runs OK the first time
but after reload same error.

I have compiled PHP 5.2.4 on Darwin Kernel Version 8.10.2.



[2004-03-31 09:57:54] christian dot lefebvre at atosorigin dot com

I got it !
Seems that when a function is declared in an included file,
after a top level "return", it's detected as already defined


example with «t1.php» :


and «t2.php» :


with cli sapi of php5 RC1 or with today snapshot, here is
the output :
inc t2
in t2
still in t2
end of t2
Here am I !!
re-inc t2

Fatal error: Cannot redeclare toto() (previously declared in
.../t2.php:13) in .../t2.php on line 14

  note that even the "in t2" log is not displayed at
second include.



[2004-03-31 09:38:46] christian dot lefebvre at atosorigin dot com

I got the same problem with RC1 version under
Linux/apache2filter
  I just tried with snapshot 200403311230 (same config)
and the message disappear but the tested code still crashes.
  As the same code works with php4.3.4, I think this ticket
should be reopened.

  I'll try to make a smaller test case



[2003-12-04 02:24:54] [EMAIL PROTECTED]

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.





[2003-11-29 01:34:32] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip





The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/18590

-- 
Edit this bug report at http://bugs.php.net/?id=18590&edit=1


#18590 [Com]: Fatal error: Cannot redeclare upon reload

2007-09-03 Thread info at rchu dot nl
 ID:   18590
 Comment by:   info at rchu dot nl
 Reported By:  armageddon at raydan dot de
 Status:   No Feedback
 Bug Type: Scripting Engine problem
 Operating System: WinXP Pro
 PHP Version:  5.0.0-dev
 New Comment:

I have sort of the same bug I think.

test.php


works fine the first time. Then after a reload it gives an cannot
redeclare test() error. Same error after second reload etc. Modify the
file (add a space or something like that) and it runs OK the first time
but after reload same error.

I have compiled PHP 5.2.4 on Darwin Kernel Version 8.10.2.


Previous Comments:


[2004-03-31 09:57:54] christian dot lefebvre at atosorigin dot com

I got it !
Seems that when a function is declared in an included file,
after a top level "return", it's detected as already defined


example with «t1.php» :


and «t2.php» :


with cli sapi of php5 RC1 or with today snapshot, here is
the output :
inc t2
in t2
still in t2
end of t2
Here am I !!
re-inc t2

Fatal error: Cannot redeclare toto() (previously declared in
.../t2.php:13) in .../t2.php on line 14

  note that even the "in t2" log is not displayed at
second include.



[2004-03-31 09:38:46] christian dot lefebvre at atosorigin dot com

I got the same problem with RC1 version under
Linux/apache2filter
  I just tried with snapshot 200403311230 (same config)
and the message disappear but the tested code still crashes.
  As the same code works with php4.3.4, I think this ticket
should be reopened.

  I'll try to make a smaller test case



[2003-12-04 02:24:54] [EMAIL PROTECTED]

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.





[2003-11-29 01:34:32] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip





[2002-07-26 07:35:22] armageddon at raydan dot de

When I run the icq_main.php script, after some seconds I get following
two errors:

Fatal error: Maximum execution time of 5 seconds exceeded in
j:\www\public\phpicq\icq\icq_main.php on line 48

Fatal error: Maximum execution time of 5 seconds exceeded in
j:\www\public\phpicq\icq\icq_debug.php on line 121

Ok, thats the excepted behaviour, but when I reload the page I get this
strange error:

Fatal error: Cannot redeclare hexdump() (previously declared in :67) in
j:\www\public\phpicq\icq\icq_debug.php on line 71

When I reload it again I get the first two error-messages again and so
on...

The following code is from icq_debug, Line 67-71:

  function HexDump($in) {
  static $hex;
  if (!$hex) $hex = new Hex();
  return $hex->Dump($in);
  }

I have loaded the following modules:
php_bz2.dll, php_cpdf.dll, php_crack.dll, php_db.dll, php_dba.dll,
php_dbase.dll, php_exif.dll, php_filepro.dll, php_gd.dll,
php_gettext.dll, php_hyperwave.dll, php_ldap.dll, php_mhash.dll,
php_pdf.dll, php_pgsql.dll, php_shmop.dll, php_snmp.dll,
php_sockets.dll, php_w32api.dll, php_zlib.dll





-- 
Edit this bug report at http://bugs.php.net/?id=18590&edit=1


#18590 [Com]: Fatal error: Cannot redeclare upon reload

2004-03-31 Thread christian dot lefebvre at atosorigin dot com
 ID:   18590
 Comment by:   christian dot lefebvre at atosorigin dot com
 Reported By:  armageddon at raydan dot de
 Status:   No Feedback
 Bug Type: Zend Engine 2 problem
 Operating System: WinXP Pro
 PHP Version:  5.0.0-dev
 New Comment:

I got it !

Seems that when a function is declared in an included file,

after a top level "return", it's detected as already defined





example with «t1.php» :





and «t2.php» :





with cli sapi of php5 RC1 or with today snapshot, here is

the output :

inc t2

in t2

still in t2

end of t2

Here am I !!

re-inc t2



Fatal error: Cannot redeclare toto() (previously declared in
.../t2.php:13) in .../t2.php on line 14



  note that even the "in t2" log is not displayed at

second include.


Previous Comments:


[2004-03-31 09:38:46] christian dot lefebvre at atosorigin dot com

I got the same problem with RC1 version under

Linux/apache2filter

  I just tried with snapshot 200403311230 (same config)

and the message disappear but the tested code still crashes.

  As the same code works with php4.3.4, I think this ticket

should be reopened.



  I'll try to make a smaller test case



[2003-12-04 02:24:54] [EMAIL PROTECTED]

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.





[2003-11-29 01:34:32] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip





[2002-07-26 07:35:22] armageddon at raydan dot de

When I run the icq_main.php script, after some seconds I get following
two errors:



Fatal error: Maximum execution time of 5 seconds exceeded in
j:\www\public\phpicq\icq\icq_main.php on line 48



Fatal error: Maximum execution time of 5 seconds exceeded in
j:\www\public\phpicq\icq\icq_debug.php on line 121



Ok, thats the excepted behaviour, but when I reload the page I get this
strange error:



Fatal error: Cannot redeclare hexdump() (previously declared in :67) in
j:\www\public\phpicq\icq\icq_debug.php on line 71



When I reload it again I get the first two error-messages again and so
on...



The following code is from icq_debug, Line 67-71:



  function HexDump($in) {

  static $hex;

  if (!$hex) $hex = new Hex();

  return $hex->Dump($in);

  }



I have loaded the following modules:

php_bz2.dll, php_cpdf.dll, php_crack.dll, php_db.dll, php_dba.dll,
php_dbase.dll, php_exif.dll, php_filepro.dll, php_gd.dll,
php_gettext.dll, php_hyperwave.dll, php_ldap.dll, php_mhash.dll,
php_pdf.dll, php_pgsql.dll, php_shmop.dll, php_snmp.dll,
php_sockets.dll, php_w32api.dll, php_zlib.dll






-- 
Edit this bug report at http://bugs.php.net/?id=18590&edit=1


#18590 [Com]: Fatal error: Cannot redeclare upon reload

2004-03-31 Thread christian dot lefebvre at atosorigin dot com
 ID:   18590
 Comment by:   christian dot lefebvre at atosorigin dot com
 Reported By:  armageddon at raydan dot de
 Status:   No Feedback
 Bug Type: Zend Engine 2 problem
 Operating System: WinXP Pro
 PHP Version:  5.0.0-dev
 New Comment:

I got the same problem with RC1 version under

Linux/apache2filter

  I just tried with snapshot 200403311230 (same config)

and the message disappear but the tested code still crashes.

  As the same code works with php4.3.4, I think this ticket

should be reopened.



  I'll try to make a smaller test case


Previous Comments:


[2003-12-04 02:24:54] [EMAIL PROTECTED]

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.





[2003-11-29 01:34:32] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip





[2002-07-26 07:35:22] armageddon at raydan dot de

When I run the icq_main.php script, after some seconds I get following
two errors:



Fatal error: Maximum execution time of 5 seconds exceeded in
j:\www\public\phpicq\icq\icq_main.php on line 48



Fatal error: Maximum execution time of 5 seconds exceeded in
j:\www\public\phpicq\icq\icq_debug.php on line 121



Ok, thats the excepted behaviour, but when I reload the page I get this
strange error:



Fatal error: Cannot redeclare hexdump() (previously declared in :67) in
j:\www\public\phpicq\icq\icq_debug.php on line 71



When I reload it again I get the first two error-messages again and so
on...



The following code is from icq_debug, Line 67-71:



  function HexDump($in) {

  static $hex;

  if (!$hex) $hex = new Hex();

  return $hex->Dump($in);

  }



I have loaded the following modules:

php_bz2.dll, php_cpdf.dll, php_crack.dll, php_db.dll, php_dba.dll,
php_dbase.dll, php_exif.dll, php_filepro.dll, php_gd.dll,
php_gettext.dll, php_hyperwave.dll, php_ldap.dll, php_mhash.dll,
php_pdf.dll, php_pgsql.dll, php_shmop.dll, php_snmp.dll,
php_sockets.dll, php_w32api.dll, php_zlib.dll






-- 
Edit this bug report at http://bugs.php.net/?id=18590&edit=1


#18590 [Com]: Fatal error: Cannot redeclare upon reload

2003-07-24 Thread vma1 at abv dot bg
 ID:   18590
 Comment by:   vma1 at abv dot bg
 Reported By:  armageddon at raydan dot de
 Status:   Verified
 Bug Type: Zend Engine 2 problem
 Operating System: WinXP Pro
 PHP Version:  5.0.0-dev
 New Comment:

Same effect here on Slackware Linux 9.0


Previous Comments:


[2003-07-13 18:28:50] ephp at sharpdreams dot com

I get the same problem on the latest build of the Win33 binary for PHP
5 test version. (Built On: Jul 13, 2003 06:30 GMT). It only happens for
me when using an interface and a class that implements the interface in
the same file. I get "cannot redeclare class output_ext" error.

Using Windows XP Prof. and Apache 2 (as a module).

Any word on if this will get fixed soon?



[2003-03-09 19:58:03] ben at pirionsystems dot com dot au

I have the same sort of thing happening with classes when the server is
under high load particularily.  The script I use is:



I'm running PHP 5.0.0 dev (built Mar 10 2003 00:10:43) under Apache
1.3.27 on Windows XP Pro. I'm also running cygwin (apache isn't running
under cygwin), so to reproduce this problem I did:

while (true); do wget http://localhost/test.php; done

After going to mozilla and reloading the same page a quite a few times
(about 30 seconds worth of CTRL-R), it comes up with:

Fatal error: Cannot redeclare class blah in c:\www\test.php  on line 2



[2002-10-17 22:45:46] [EMAIL PROTECTED]

In latest version of ZendEngine 2 the last example results a core dump.
Here is the backtrace:
#0  0x80e42bc in _efree (ptr=0x401b4748, __zend_filename=0x813a0c0
"/home/rei/PHP_CVS/php4/Zend/zend_opcode.c", __zend_lineno=124,
__zend_orig_filename=0x0, __zend_orig_lineno=0) at
/home/rei/PHP_CVS/php4/Zend/zend_alloc.c:238
#1  0x80f002d in destroy_zend_class (pce=0x8154e34) at
/home/rei/PHP_CVS/php4/Zend/zend_opcode.c:124
#2  0x80fd25a in zend_hash_destroy (ht=0x814b840) at
/home/rei/PHP_CVS/php4/Zend/zend_hash.c:541
#3  0x80f72a2 in zend_shutdown () at
/home/rei/PHP_CVS/php4/Zend/zend.c:539
#4  0x80c3d9f in php_module_shutdown () at
/home/rei/PHP_CVS/php4/main/main.c:1190
#5  0x8113004 in main (argc=2, argv=0xb7f4) at
/home/rei/PHP_CVS/php4/sapi/cli/php_cli.c:753
#6  0x400b4f5c in __libc_start_main (main=0x8112590 , argc=2,
ubp_av=0xb7f4, init=0x8059b30 <_init>, fini=0x81135bc <_fini>,
rtld_fini=0x4000ce30 <_dl_fini>, stack_end=0xb7ec) at
../sysdeps/generic/libc-start.c:129

ZE1 does not core however it does show 4 memory leaks:
/home/rei/PHP_CVS/php4/Zend/zend_API.c(597) :  Freeing 0x0836ED0C (44
bytes), script=z2.php
/home/rei/PHP_CVS/php4/Zend/zend_API.c(585) : Actual location (location
was relayed)
/home/rei/PHP_CVS/php4/Zend/zend_hash.c(178) :  Freeing 0x083696F4 (32
bytes), script=z2.php
/home/rei/PHP_CVS/php4/Zend/zend_execute.c(1956) :  Freeing 0x08368B3C
(12 bytes), script=z2.php



[2002-08-07 02:16:35] optikSmoke at subdimension dot com

I have also been having problems with the "redeclare upon 
reload" bug for awhile, so I decided to see if I could 
isolate the code that was causing the problem. After a 
good deal of thinning down code, I believe I have figured 
it out (for my case, anyway). Observe the following 
script: 
 
 
 
The first time I load it, everything is fine. The second 
time, it says "Fatal error: Cannot redeclare class biff in 
biff.php on line 2". I hit reload again, and everything is 
fine. Hit it again, fatal error. And so on. 
 
It appears that putting exit() in the __destruct() method 
of an object causes this problem. 
 
Further testing revealed that the script will die upon the 
first declaration of any class or function. For example, 
you could declare a function called "foo" before the 
"biff" class, and it would be reported as redeclared, 
instead of "biff". 
 
On top of that, testing with a function also indicates 
"where" the function was redeclared from. This is not a 
bug, but it is useful information: especially since it 
tosses up garbage. For example, adding the "function foo() 
{}" at the beginning of the file causes this error: 
 
Cannot redeclare foo() (previously declared in I+V?:2) in 
biff.php on line 2 
 
Generally, it seems to say "previously declared in 
biff.php" once, then every time afterwards it will turn up 
garbage for the file name. This garbage changes for each 
reload. 
 
I am using cvs from August 5th, with Zend 2, as a module 
in Apache 1.3.23, Mandrake 8.2 (kernel 2.4.18), and glibc 
2.2.4.



[2002-07-27 05:54:33] armageddon at raydan dot de

Updated to Apache 1.3.26 but still the same problem...



The r

#18590 [Com]: Fatal error: Cannot redeclare upon reload

2003-07-13 Thread ephp at sharpdreams dot com
 ID:   18590
 Comment by:   ephp at sharpdreams dot com
 Reported By:  armageddon at raydan dot de
 Status:   Verified
 Bug Type: Zend Engine 2 problem
 Operating System: WinXP Pro
 PHP Version:  5.0.0-dev
 New Comment:

I get the same problem on the latest build of the Win33 binary for PHP
5 test version. (Built On: Jul 13, 2003 06:30 GMT). It only happens for
me when using an interface and a class that implements the interface in
the same file. I get "cannot redeclare class output_ext" error.

Using Windows XP Prof. and Apache 2 (as a module).

Any word on if this will get fixed soon?


Previous Comments:


[2003-03-09 19:58:03] ben at pirionsystems dot com dot au

I have the same sort of thing happening with classes when the server is
under high load particularily.  The script I use is:



I'm running PHP 5.0.0 dev (built Mar 10 2003 00:10:43) under Apache
1.3.27 on Windows XP Pro. I'm also running cygwin (apache isn't running
under cygwin), so to reproduce this problem I did:

while (true); do wget http://localhost/test.php; done

After going to mozilla and reloading the same page a quite a few times
(about 30 seconds worth of CTRL-R), it comes up with:

Fatal error: Cannot redeclare class blah in c:\www\test.php  on line 2



[2002-10-17 22:45:46] [EMAIL PROTECTED]

In latest version of ZendEngine 2 the last example results a core dump.
Here is the backtrace:
#0  0x80e42bc in _efree (ptr=0x401b4748, __zend_filename=0x813a0c0
"/home/rei/PHP_CVS/php4/Zend/zend_opcode.c", __zend_lineno=124,
__zend_orig_filename=0x0, __zend_orig_lineno=0) at
/home/rei/PHP_CVS/php4/Zend/zend_alloc.c:238
#1  0x80f002d in destroy_zend_class (pce=0x8154e34) at
/home/rei/PHP_CVS/php4/Zend/zend_opcode.c:124
#2  0x80fd25a in zend_hash_destroy (ht=0x814b840) at
/home/rei/PHP_CVS/php4/Zend/zend_hash.c:541
#3  0x80f72a2 in zend_shutdown () at
/home/rei/PHP_CVS/php4/Zend/zend.c:539
#4  0x80c3d9f in php_module_shutdown () at
/home/rei/PHP_CVS/php4/main/main.c:1190
#5  0x8113004 in main (argc=2, argv=0xb7f4) at
/home/rei/PHP_CVS/php4/sapi/cli/php_cli.c:753
#6  0x400b4f5c in __libc_start_main (main=0x8112590 , argc=2,
ubp_av=0xb7f4, init=0x8059b30 <_init>, fini=0x81135bc <_fini>,
rtld_fini=0x4000ce30 <_dl_fini>, stack_end=0xb7ec) at
../sysdeps/generic/libc-start.c:129

ZE1 does not core however it does show 4 memory leaks:
/home/rei/PHP_CVS/php4/Zend/zend_API.c(597) :  Freeing 0x0836ED0C (44
bytes), script=z2.php
/home/rei/PHP_CVS/php4/Zend/zend_API.c(585) : Actual location (location
was relayed)
/home/rei/PHP_CVS/php4/Zend/zend_hash.c(178) :  Freeing 0x083696F4 (32
bytes), script=z2.php
/home/rei/PHP_CVS/php4/Zend/zend_execute.c(1956) :  Freeing 0x08368B3C
(12 bytes), script=z2.php



[2002-08-07 02:16:35] optikSmoke at subdimension dot com

I have also been having problems with the "redeclare upon 
reload" bug for awhile, so I decided to see if I could 
isolate the code that was causing the problem. After a 
good deal of thinning down code, I believe I have figured 
it out (for my case, anyway). Observe the following 
script: 
 
 
 
The first time I load it, everything is fine. The second 
time, it says "Fatal error: Cannot redeclare class biff in 
biff.php on line 2". I hit reload again, and everything is 
fine. Hit it again, fatal error. And so on. 
 
It appears that putting exit() in the __destruct() method 
of an object causes this problem. 
 
Further testing revealed that the script will die upon the 
first declaration of any class or function. For example, 
you could declare a function called "foo" before the 
"biff" class, and it would be reported as redeclared, 
instead of "biff". 
 
On top of that, testing with a function also indicates 
"where" the function was redeclared from. This is not a 
bug, but it is useful information: especially since it 
tosses up garbage. For example, adding the "function foo() 
{}" at the beginning of the file causes this error: 
 
Cannot redeclare foo() (previously declared in I+V?:2) in 
biff.php on line 2 
 
Generally, it seems to say "previously declared in 
biff.php" once, then every time afterwards it will turn up 
garbage for the file name. This garbage changes for each 
reload. 
 
I am using cvs from August 5th, with Zend 2, as a module 
in Apache 1.3.23, Mandrake 8.2 (kernel 2.4.18), and glibc 
2.2.4.



[2002-07-27 05:54:33] armageddon at raydan dot de

Updated to Apache 1.3.26 but still the same problem...



[2002-07-27 05:16:39] [EMAIL PROTECTED]

You can safely upgrade from 1.3.24 to 1.3.26, but I doubt that will fix
things.

Derick


#18590 [Com]: Fatal error: Cannot redeclare upon reload

2003-03-09 Thread ben at pirionsystems dot com dot au
 ID:   18590
 Comment by:   ben at pirionsystems dot com dot au
 Reported By:  armageddon at raydan dot de
 Status:   Verified
 Bug Type: Zend Engine 2 problem
 Operating System: WinXP Pro
 PHP Version:  4.3.0-dev
 New Comment:

I have the same sort of thing happening with classes when the server is
under high load particularily.  The script I use is:



I'm running PHP 5.0.0 dev (built Mar 10 2003 00:10:43) under Apache
1.3.27 on Windows XP Pro. I'm also running cygwin (apache isn't running
under cygwin), so to reproduce this problem I did:

while (true); do wget http://localhost/test.php; done

After going to mozilla and reloading the same page a quite a few times
(about 30 seconds worth of CTRL-R), it comes up with:

Fatal error: Cannot redeclare class blah in c:\www\test.php  on line 2


Previous Comments:


[2002-10-17 22:45:46] [EMAIL PROTECTED]

In latest version of ZendEngine 2 the last example results a core dump.
Here is the backtrace:
#0  0x80e42bc in _efree (ptr=0x401b4748, __zend_filename=0x813a0c0
"/home/rei/PHP_CVS/php4/Zend/zend_opcode.c", __zend_lineno=124,
__zend_orig_filename=0x0, __zend_orig_lineno=0) at
/home/rei/PHP_CVS/php4/Zend/zend_alloc.c:238
#1  0x80f002d in destroy_zend_class (pce=0x8154e34) at
/home/rei/PHP_CVS/php4/Zend/zend_opcode.c:124
#2  0x80fd25a in zend_hash_destroy (ht=0x814b840) at
/home/rei/PHP_CVS/php4/Zend/zend_hash.c:541
#3  0x80f72a2 in zend_shutdown () at
/home/rei/PHP_CVS/php4/Zend/zend.c:539
#4  0x80c3d9f in php_module_shutdown () at
/home/rei/PHP_CVS/php4/main/main.c:1190
#5  0x8113004 in main (argc=2, argv=0xb7f4) at
/home/rei/PHP_CVS/php4/sapi/cli/php_cli.c:753
#6  0x400b4f5c in __libc_start_main (main=0x8112590 , argc=2,
ubp_av=0xb7f4, init=0x8059b30 <_init>, fini=0x81135bc <_fini>,
rtld_fini=0x4000ce30 <_dl_fini>, stack_end=0xb7ec) at
../sysdeps/generic/libc-start.c:129

ZE1 does not core however it does show 4 memory leaks:
/home/rei/PHP_CVS/php4/Zend/zend_API.c(597) :  Freeing 0x0836ED0C (44
bytes), script=z2.php
/home/rei/PHP_CVS/php4/Zend/zend_API.c(585) : Actual location (location
was relayed)
/home/rei/PHP_CVS/php4/Zend/zend_hash.c(178) :  Freeing 0x083696F4 (32
bytes), script=z2.php
/home/rei/PHP_CVS/php4/Zend/zend_execute.c(1956) :  Freeing 0x08368B3C
(12 bytes), script=z2.php



[2002-08-07 02:16:35] optikSmoke at subdimension dot com

I have also been having problems with the "redeclare upon 
reload" bug for awhile, so I decided to see if I could 
isolate the code that was causing the problem. After a 
good deal of thinning down code, I believe I have figured 
it out (for my case, anyway). Observe the following 
script: 
 
 
 
The first time I load it, everything is fine. The second 
time, it says "Fatal error: Cannot redeclare class biff in 
biff.php on line 2". I hit reload again, and everything is 
fine. Hit it again, fatal error. And so on. 
 
It appears that putting exit() in the __destruct() method 
of an object causes this problem. 
 
Further testing revealed that the script will die upon the 
first declaration of any class or function. For example, 
you could declare a function called "foo" before the 
"biff" class, and it would be reported as redeclared, 
instead of "biff". 
 
On top of that, testing with a function also indicates 
"where" the function was redeclared from. This is not a 
bug, but it is useful information: especially since it 
tosses up garbage. For example, adding the "function foo() 
{}" at the beginning of the file causes this error: 
 
Cannot redeclare foo() (previously declared in I+V?:2) in 
biff.php on line 2 
 
Generally, it seems to say "previously declared in 
biff.php" once, then every time afterwards it will turn up 
garbage for the file name. This garbage changes for each 
reload. 
 
I am using cvs from August 5th, with Zend 2, as a module 
in Apache 1.3.23, Mandrake 8.2 (kernel 2.4.18), and glibc 
2.2.4.



[2002-07-27 05:54:33] armageddon at raydan dot de

Updated to Apache 1.3.26 but still the same problem...



[2002-07-27 05:16:39] [EMAIL PROTECTED]

You can safely upgrade from 1.3.24 to 1.3.26, but I doubt that will fix
things.

Derick



[2002-07-27 05:13:13] armageddon at raydan dot de

> 1. Update Apache

I'm unable to update Apache because PHP fails to load as a module with
Apache 2.0.39.

> Umm in php.ini see if theres an execution time limit, if so change it
to 0

It was intended that the script stops after 5 seconds (And that's not
my problem...)



The remainder of the comments for this report are too long. T