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:

; this is a comment

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


Restart apache / nginx