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

Issue Type: Bug Created: 2010-01-28T00:45:38.000+0000 Last Updated: 2010-02-11T02:43:34.000+0000 Status: Resolved Fix version(s): - 1.10.1 (10/Feb/10)

Reporter: André Schade (toocan) Assignee: Matthew Weier O'Phinney (matthew) Tags: Related issues: Attachments: - ZF-8984.diff


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.


Posted by André Schade (toocan) on 2010-01-29T02:11:38.000+0000

We are no able to update due this error!

Posted by Matthew Weier O'Phinney (matthew) on 2010-01-29T04:59:07.000+0000

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.

Posted by André Schade (toocan) on 2010-01-29T05:17:28.000+0000

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

Posted by Matthew Weier O'Phinney (matthew) on 2010-02-03T10:57:29.000+0000

It appears to be resolved in XCache 1.3.0.

Posted by Matthew Weier O'Phinney (matthew) on 2010-02-03T11:00:41.000+0000

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.

Posted by André Schade (toocan) on 2010-02-03T12:33:30.000+0000

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.

Posted by Jan Pieper (jpieper) on 2010-02-03T12:56:16.000+0000

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.

Posted by André Schade (toocan) on 2010-02-03T13:16:54.000+0000

Another policy is: Do not to change the library to stay upgradable. ;-) So we are really not able to use it at all.

Posted by Matthew Weier O'Phinney (matthew) on 2010-02-04T05:13:23.000+0000

@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.

Posted by André Schade (toocan) on 2010-02-04T05:35:22.000+0000

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...

Posted by André Schade (toocan) on 2010-02-04T05:36:14.000+0000

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

Posted by Jan Pieper (jpieper) on 2010-02-07T14:57:04.000+0000

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

Posted by André Schade (toocan) on 2010-02-08T00:02:12.000+0000

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. ;-)

Posted by Matthew Weier O'Phinney (matthew) on 2010-02-08T05:11:12.000+0000

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


Posted by Matthew Weier O'Phinney (matthew) on 2010-02-08T07:39:39.000+0000

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

Posted by André Schade (toocan) on 2010-02-11T02:43:32.000+0000

Thanks a lot, works fine!

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.