Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Just installed php5-fpm. All sources say that apc module has been replaced with OPcache and it's compiled by default but not enabled.

How can I enable this module. I can not find file on my server

I have checked /usr/lib/php5 and /etc/php5 but can not find it.

php -v
PHP 5.4.4-14+deb7u4 (cli) (built: Aug 23 2013 14:37:41)
share|improve this question

3 Answers 3

You can update PHP like shaun m says, or if you don't want to do that you can install zendopcache from PECL

Check for latest version here, this installs version 7.0.3.

Install "pecl" via php-pear

`sudo apt-get install -y php-pear`

Install build dependencies

sudo apt-get install -y build-essential php5-dev

Install Zend OpCache

sudo pecl install zendopcache-7.0.3

Find the location of

sudo find / -name ''

Mine is


Now create opcache.ini

sudo vim /etc/php5/mods-available/opcache.ini

Add this info

zend_extension=/usr/lib/php5/20100525/ # File path from above

Now create a symlink for the conf file

sudo ln -s /etc/php5/mods-available/opcache.ini /etc/php5/conf.d/20-opcache.ini

Restart services

sudo service php5-fpm restart
sudo service apache2 restart

Confirm install

php -v

It should give mention of

Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies

Then (optionally) finish by cleaning up

sudo apt-get remove --purge build-essential php5-dev


share|improve this answer

OPCache is only enabled and compiled in by default in the new PHP 5.5, not the 5.4 that comes with Wheezy. If you'd like to use OPCache and PHP 5.5 in Debian, you'll have to add the dotdeb repos (see below) and install from there.

deb wheezy-php55 all 
deb-src wheezy-php55 all
share|improve this answer

You can install APC whit pecl

pecl install apc

php-pear en php-dev is needed for install it.

Or you can install whit apt-get

apt-get install php5-apc
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.