Report this

What is the reason for this report?

Enable PHP 5.5 Opcache on Ubuntu 14.04 with Nginx and PHP-FPM

Posted on May 15, 2014

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.