4

After configuring OPCache as recomanded, It's not working.

So, How to debug OPCache to see where is the problem?

Or I am missing something?

My config:

php.ini enter image description here

php -v enter image description here

enter image description here

And in code

opcache_get_status(); // return false
//but
extension_loaded('Zend OPcache') // return true
Tiny
  • 27,221
  • 105
  • 339
  • 599
tasmaniski
  • 4,767
  • 3
  • 33
  • 65
  • I've answered this Q 2 or 3 times on this tag. Opcache uses a SMA between processes forked from a common parent. Since the scope of a CLI invocation is a single request, it does nothing when executed in a CLI context. Search the previous [opcache] Qs for further details. – TerryE Mar 06 '15 at 13:43
  • I didn't executed in a CLI context, it is on website via apache. But I will look at the tag, thanks! – tasmaniski Mar 06 '15 at 14:09
  • in which case the cli `php -v` isn't relevant. You need the the `mod_php5` version and you need to run any `opcache_*` API calls as a web request event if just a `wget` from a localhost URI to get meaningful diagnostics – TerryE Mar 07 '15 at 17:45

2 Answers2

3

It has been quite some time so I imagine you have moved on from this issue but in case you have not. Is noticed you are running Xdebug...

Have you checked your php.ini to make sure that the following is not an issue?

If you want to use OPcache with » Xdebug, you must load OPcache before Xdebug.

http://php.net/manual/en/opcache.installation.php

The other thing probably worth mentioning is that you do not need to specify the path to the shared library. The following should suffice:

zend_extension=opcache.so
2

I had same problem. I have edited php.ini file in C:\wamp\bin\apache\apache2.4.17\bin location and problem solved. however before I edited php.ini in C:\wamp\bin\php\php5.6.15 path. at all you should edit php.ini file in C:\wamp\bin\apache\apache2.4.17\bin path. I am enjoying speed of OPCache!