"Cannot redeclare class" messages in php.log

Follow

Issue

When running our app on Zend Server, there are repeated "Cannot redeclare class" messages in the php log file.  The following is an example of the message:

[09-Sep-2014 09:42:54 America/Anguilla] PHP Fatal error: Cannot redeclare class TestClass in /usr/local/zend/var/apps/http/__default__/0/1.0.0.0_4/wwwdata/zf/application/models/TestClass.php on line 0

Environment

Zend Server

OPcache enabled

Resolution

In the Zend Server UI, navigate to Administration > Components > Zend OPcache.  Set the directive opcache.dups_fix to ON.  Click the save button near the top of the page.  Restart Zend Server via the icon at the top right.

Details

In older versions of Zend Server, you may see the text listed as "Optimizer+" instead of "OPcache".

A full description of the page can be found in the OPcache Duplicate Functions Fix section of the documentation page Working with OPcache

Have more questions? Submit a request

Comments

Powered by Zendesk