Installing APC op-code cache on Ubuntu 10.04

转载 2012年03月29日 15:21:50

In this article, I will explain how to install the APC opcode cache in a few easy steps, on Ubuntu 10.04.
APC is an opcode cache (and more). When a PHP script is run, it is compiled by PHP internally, before executing it. PHP does not store the compiled result, therefore, next time the script is run, PHP will compile it again. APC is designed to store the result in its cache. This way, when PHP executes again a script, APC will serve the compiled script from the cache. PHP won't have to parse the script again, and it will save a lot of time.

First step: install PECL

apt-get install apache2-threaded-dev php5-dev php-pear make

Second step: install APC

pecl install apc

APC will ask this question:
Use apxs to set compile flags (if using APC with Apache)? [yes] :

Just answer: yes

PECL will compile the APC extension and generate a extension file. We need to be sure PHP knows about this file.

Note: if the build fails with this message:
/tmp/pear/temp/APC/php_apc.c:959: error: duplicate ‘static’
make: *** [php_apc.lo] Erreur 1
ERROR: `make' failed

then you might have to retry with a newer version of APC (as of July 2010, the latest stable version of APC does not completely support PHP 5.3 it seems).
Try this instead:
pecl install apc-beta

Third step: enable the extension

cd /etc/php5/conf.d/
nano apc.ini

In the apc.ini file, write:


vi /etc/php5/apache2/php.ini


Finally, restart Apache:

/etc/init.d/apache2 restart


Caching With Apache's mod_cache On Ubuntu 10.04 Version 1.0 Author...
  • kvgnt
  • kvgnt
  • 2012年10月10日 13:55
  • 855

installing samba on ubuntu

  • 2010年03月08日 10:33
  • 1KB
  • 下载

Installing STLinux on Ubuntu

  • 2013年07月14日 13:25
  • 27KB
  • 下载

Installing Zend Server Community Edition (CE) on Ubuntu 10.04.3 LTS

Posted on September 7, 2011 by tommie Looking for a fast, reliable and easy PHP stack on ...
  • alaclp
  • alaclp
  • 2012年07月21日 10:45
  • 706

SimpleScalar Installation On Ubuntu 10.04

  • 2011年12月08日 14:47
  • 11KB
  • 下载

Installing Ubuntu 14.04 on a Pre-Installed Windows 8 (64-bit) System (UEFI Supported)

Useful Links: Install Ubuntu 14.04 alongside Windows 8.1 in 10 easy steps教程:Ubuntu 14.04 和 Windows ...
  • orzorz
  • orzorz
  • 2014年12月14日 08:55
  • 1086

【安装Hadoop 2.3 集群】Installing Hadoop 2.3.0 multi-node cluster on Ubuntu 13.10

Installing Hadoop 2.3.0 multi-node cluster on Ubuntu 13.10 【】 Make sure you have Oracle JDK 7 ...
  • nisxiya
  • nisxiya
  • 2014年09月02日 21:42
  • 732

Installing Odoo 9 on Ubuntu 14.04

Hi guys, 1. Introduction In this tutorial I will learn you how to install Odoo 9 on Ubuntu 14....

Installing Django on an Ubuntu Linux Server

Installing Django on an Ubuntu Linux Server Today I had the task of installing a development ...
  • alaclp
  • alaclp
  • 2012年07月21日 00:45
  • 814
您举报文章:Installing APC op-code cache on Ubuntu 10.04