Debugging Problems When Zend OPcache Is Loaded


PHP5.5 that comes with Ubuntu distributions (and maybe other distributions) includes Zend OPcache by default. If configured incorrectly, it loads after Zend Debugger, which causes debugging problems.

In order to solve the problem, follow these steps:

  1. Go to php.ini file(vi /etc/php5/apache2/php.ini), comment/remove the below line and save the file:

  2. Go to /etc/php5/apache2/conf.d directory.

  3. Create a file called: 08-debugger.ini. The number in the file's name determines the extensions' order of loading; and Zend Debugger needs to be loaded only after Zend OPcache. Add the directive below to the newly created file:

  4. Restart apache2 service.

  5. Re-load the phpinfo() page and make sure that Zend OPcache is loading before Zend Debugger.