PHP 5.5 and OpCache

Recently, I upgraded my Debian server to Wheezy and now running PHP 5.5 with Zend OpCache.

After the upgrade Piwik would just show a blank screen…no errors in logs to view.

I ended up troubleshooting the problem back to OpCache by disabling it. However, I would like this running for other vhosts on the VPS.

I then tried to use OpCache blacklist to disable OpCache on the Piwik installation only…but it didn’t work.

The only way I can get Piwik to work is by disabling completely.

Any ideas how to simultaneously use Piwik and OpCache? Is anyone else having this problem?

Also, important to note I’m running Nginx with PHP-FPM.

Thanks for your help.

Are you sure you don’t have any other module that could create the problem, like mod_pagespeed, Wincache, etc?

I believe there are thousands of people using PHP 5.5 (with the built-in opcache enabled by default) without problem. By the way just to be sure when you say Zend Opcache you mean the built-in opcache in PHP 5.5 right?

Hi and thanks for your reply. Yes, I’m referring to the built in opcache. Strange thing is when I disable opcache, all of Piwik works great. I’m really stumped and any other ideas would be very helpful. Thanks again.

Have you changed the configuration of opcache in any way? (e.g. disable the thing that checks if files have been modified to invalidate the cache)

I honestly don’t see a reason, I’m using PHP 5.6 myself with the default config and no problems.

Yes, here is what it currently reads:

Please let me know if anything seems like it would be an issue.

I have honestly no idea. You don’t seem to override those settings but please just check that opcache.validate_timestamps is enabled (PHP: Runtime Configuration - Manual) (it could mess up Piwik’s PHP files cache maybe) and save_comments/load_comments are enabled too (PHP: Runtime Configuration - Manual).

Also try to restart apache/php-fpm after enabling opcache, maybe there’s a stale cache and for some reason it doesn’t get invalidated (maybe because of opcache.revalidate_freq=60)

All settings verified and thank you so much for your help! I was previously on PHP5.4 and did an upgrade to my server, after which these problems started. Turns out my php.ini file was missing all the opcache settings and I had them in the opcache.ini file (thinking it would be ok there). So, I found a newer php.ini file for PHP5.5 and everything works great :slight_smile:

So…after running for a few days, it broke again. The login screen is just blank and error logs are empty. Back to the drawing board!

Hi there

what’s the error in the server error log?

There are no errors being reported. Is there a debug option for Piwik to turn on?

Finally have a fix to this if someone has the same issue…

OpCache does indeed work with Piwik.

I had to “blacklist” the main install index.php file within opcache.