Using PHP and OpCache

 Installing on Redhat / centos

yum install php56-opcache

Stop opcache caching anything

set opcache.revalidate_freq to 0 in php.ini or /etc/php.d/10-opcache.ini

 Ignore certain files / directories

Create a blacklist.txt file somewhere on your filesystem (for example /etc/opcache-blacklist.txt or /etc/php.d/opcache-default.blacklist

The file should contain items like:

/var/www/vhosts/site/app/views/*
/var/www/vhosts/site/app/controllers/*
/var/www/vhosts/site/public/index.php
; this is a comment

Edit /etc/php.ini or /etc/php.d/10-opcache.ini and add the line:

    opcache.blacklist_filename=/etc/opcache-blacklist.txt

Restart apache / nginx