OPcache improves PHP performance by storing precompiled script bytecode in shared memory, thereby removing the need for PHP to load and parse scripts on each request.

Making the switch from APC to Opcache now that it’s standard with Ubuntu 14.04. All the tutorials seemed to be on Apache so thought I’d share what I did. The first change and restarting php I believe is all you need to do while the other changes are for performance and will vary based on your needs. If others have recommendations or additional advice please pipe in!

sudo vim /etc/php5/fpm/php.ini

Change:

;opcache.enable=0 to opcache.enable=1

Change:

;opcache.memory_consumption=64 to opcache.memory_consumption=128

Change:

;opcache.max_accelerated_files=2000 to opcache.max_accelerated_files=4000

Change:

;opcache.revalidate_freq=2 to opcache.revalidate_freq=60

Then restart:

sudo service php5-fpm restart
sudo service nginx restart