3

I use composer to install Zend Framework 2 and other libraries. Every time after re-installing an application in the same path, I have to manually clear the APC (version 3.1.13) opcode cache (with PHP 5.4.8), otherwise I get errors like

PHP Fatal error:  Interface 'Zend\\Mvc\\ApplicationInterface' not found

or

PHP Fatal error:  include(): Cannot redeclare class zend\\eventmanager\\eventscapableinterface

The failing class keeps changing after every application install. I have apc.stat=1, so the opcode cache should notice newly deployed php files and recompile them automatically, if I have deployed the application on the same path before.

I have discussed the problem on Github with the composer developers and posted my APC settings here: https://github.com/composer/composer/issues/1662. We agree that this looks more like an APC problem.

6
  • I guess I could automatize APC opcode cache clearing using the somewhat complicated solution here: stackoverflow.com/a/3580939/94289. But I hope there's some easier fix. Commented Mar 6, 2013 at 11:03
  • 1
    touch all your updated files so they have a new timestamp, apc is pretty dumb. Commented Mar 13, 2013 at 21:57
  • I've seen somewhere on mailing list that there are problems with APC and PHP5.4, unfortunately I can't find it, to see what exactly was said. Commented Mar 13, 2013 at 22:01
  • Does this question help at all? PHP with APC: Fatal errors: Cannot redeclare class ... one suggestion is to try changing apc.include_once_override = 0 Commented Mar 14, 2013 at 0:02
  • Thanks for the suggestions! @SimonHampel I already have apc.include_once_override = 0, see here. @ZdenekMachek I'll try but since I delete the whole vendor folder (containing Zend Framework) upon reinstall and then install the contents again (from composer cache), I think the file timestamps should be updated automatically.. Commented Mar 15, 2013 at 8:37

1 Answer 1

0

I think that is include_path setted up twice. When include_path called twice it will make confusing to APC reading and parsing. Make sure that your ZEND project are not called twice on include_path.

And another checkout that you are properly configure ini settings or put manually ini settings data:

apc.include_once_override = 0
apc.canonicalize = 0
apc.stat = 0

In meanwhile this issue can be already solved due to updates.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.