Setting up Zend Optimizer+ – php5-opcache – on Raspberry Pi with Raspian

Now the Raspberry Pi doesn’t come with the opcache as a package. Well, at least I couldn’t find it. So I compiled it, and it was relatively easy and fast!

I did all this as root, I’m 90% sure you need to be, but you could try as the pi user and see what happens. But anyway, log in on the command line and $ sudo -i to get an interactive superuser prompt.

I’m assuming you have a webserver (nginx or apache) installed and set up using php-fpm.

First install php development tools and git. $ apt-get install php5-dev git

Now download the source.

$ git clone

$ cd ZendOptimizerPlus

The next command phpizes your downloaded source, it customises a few things to make it work with your install.

$ phpize


$ ./configure --with-php-config=/usr/bin/php-config


$ make -j 2


$ make install

Make a note of the directory it installs into. I’m assuming you’re using the php-fpm way of doing things, but if not, adjust accordingly.

Now get your favourite code editor up and edit: /etc/php5/fpm/conf.d/20-opcache.ini

Pop this into that file:

zend_extension=--the directory you noted down--/

opcache.revalidate_freq=60 #set this to 0 if running a development server

Now restart php. $ service php5-fpm restart

And you’re done. One php opcache. Speedy!

Leave a Reply

Your email address will not be published. Required fields are marked *