Zend Framework

Fatal error: Cannot redeclare class Zend_Exception in [...]/Exception.php on line 28 (xcache enabled)

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 1.10.0
  • Fix Version/s: 1.10.1
  • Component/s: None
  • Labels:
    None

Description

With php < 5.3 and xcache enabled the Zend_Exception throws a Fatal Error as described on Nabble.

Disabling xcache or removing the else section solves the problem but thats not an acceptable resolution.

Activity

Hide
André Schade added a comment -

We are no able to update due this error!

Show
André Schade added a comment - We are no able to update due this error!
Hide
Matthew Weier O'Phinney added a comment -

This is, quite simply, bad behavior on the part of xcache; other opcode caches, such as APC and Zend Optimizer, behave correctly with the conditional class definition.

I will attempt to resolve the issue, but you should also report it upstream to the xcache developers.

Show
Matthew Weier O'Phinney added a comment - This is, quite simply, bad behavior on the part of xcache; other opcode caches, such as APC and Zend Optimizer, behave correctly with the conditional class definition. I will attempt to resolve the issue, but you should also report it upstream to the xcache developers.
Hide
André Schade added a comment -

Thanks.
I opened a ticket in the xcache trac. Ticket #234

Show
André Schade added a comment - Thanks. I opened a ticket in the xcache trac. Ticket #234
Hide
Matthew Weier O'Phinney added a comment -

It appears to be resolved in XCache 1.3.0.

Show
Matthew Weier O'Phinney added a comment - It appears to be resolved in XCache 1.3.0.
Hide
Matthew Weier O'Phinney added a comment -

Since the issue was upstream, and the upstream provider has a release that corrects the issue, no further work needs to be done on the ZF side.

If you are using XCache and have the issue as reported, upgrade to XCache 1.3.0.

Show
Matthew Weier O'Phinney added a comment - Since the issue was upstream, and the upstream provider has a release that corrects the issue, no further work needs to be done on the ZF side. If you are using XCache and have the issue as reported, upgrade to XCache 1.3.0.
Hide
André Schade added a comment -

We use Ubuntu 9.10 from an automated installation with stable packages and security updates. We have a policy to only use supported stable packages so I'm not able/allowed to use XCache > 1.2.2 for now.
Thank you for your efforts.

Show
André Schade added a comment - We use Ubuntu 9.10 from an automated installation with stable packages and security updates. We have a policy to only use supported stable packages so I'm not able/allowed to use XCache > 1.2.2 for now. Thank you for your efforts.
Hide
Jan Pieper added a comment -

We have the same problem. We removed not needed Zend_Exception class declaration from Zend/Exception.php to use ZF 1.10. Seems to be the only way at the moment.

Show
Jan Pieper added a comment - We have the same problem. We removed not needed Zend_Exception class declaration from Zend/Exception.php to use ZF 1.10. Seems to be the only way at the moment.
Hide
André Schade added a comment -

Another policy is: Do not to change the library to stay upgradable.

So we are really not able to use it at all.

Show
André Schade added a comment - Another policy is: Do not to change the library to stay upgradable. So we are really not able to use it at all.
Hide
Matthew Weier O'Phinney added a comment -

@Andre: This change works under normal installs of PHP; the problem here is entirely in a 3rd party, unofficial extension to PHP – and, as noted, newer releases to that extension correct the issue. We simply cannot target every possible extension combination possible to PHP.

If you are not using svn:externals, you can simply modify the library/Zend/Exception.php file to remove the condition.

Show
Matthew Weier O'Phinney added a comment - @Andre: This change works under normal installs of PHP; the problem here is entirely in a 3rd party, unofficial extension to PHP – and, as noted, newer releases to that extension correct the issue. We simply cannot target every possible extension combination possible to PHP. If you are not using svn:externals, you can simply modify the library/Zend/Exception.php file to remove the condition.
Hide
André Schade added a comment -

Thanks Matthew, but thats exactly how its implemented in your application - as an svn:externals property in your library and it will be updated/exported in the build process. In development it's ok to remove the condition...

Show
André Schade added a comment - Thanks Matthew, but thats exactly how its implemented in your application - as an svn:externals property in your library and it will be updated/exported in the build process. In development it's ok to remove the condition...
Hide
André Schade added a comment -

ups: ... how its implemented in 'our' application.

Show
André Schade added a comment - ups: ... how its implemented in 'our' application.
Hide
Jan Pieper added a comment -

Could this (see attached file) be a solution? (untested)

Show
Jan Pieper added a comment - Could this (see attached file) be a solution? (untested)
Hide
André Schade added a comment -

Thanks for the path. I'll try it next week. End of this week we have a release and I don't think that it would make all happy to change the library shortly before that.

Show
André Schade added a comment - Thanks for the path. I'll try it next week. End of this week we have a release and I don't think that it would make all happy to change the library shortly before that.
Hide
Matthew Weier O'Phinney added a comment -

That patch would definitely solve the issue; I'll apply it today for the 1.10.1 release.

Thanks!

Show
Matthew Weier O'Phinney added a comment - That patch would definitely solve the issue; I'll apply it today for the 1.10.1 release. Thanks!
Hide
Matthew Weier O'Phinney added a comment -

Patch applied, with modifications, to trunk and 1.10 release branch.

Show
Matthew Weier O'Phinney added a comment - Patch applied, with modifications, to trunk and 1.10 release branch.
Hide
André Schade added a comment -

Thanks a lot, works fine!

Show
André Schade added a comment - Thanks a lot, works fine!

People

Vote (2)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: