Ubuntu 10.04: Setup APC for PHP 5.3 and Apache2

Installing the APC (Alternative PHP Cache) using the php-apc package is straightforward:

# sudo aptitude install php-apc
# sudo /etc/init.d/apache2 restart

Using the package php-apc installs APC 3.1.3p1. If you would like to use the most recent version 3.1.4 you can manually set up the PECL package as follows:

  1. Install the required packages:
    # sudo apt-get install php-pear php5-dev apache2-threaded-dev
  2. Install APC:
    # sudo pecl install apc-3.1.4
  3. Create file /etc/php5/conf.d/apc.ini with the following content:
    extension=apc.so
  4. Restart Apache2:
    # sudo /etc/init.d/apache2 restart

After restarting the Apache2 web server a APC section should be included in the phpinfo() output.

Comments

  1. Geeko

    Thank you!
    It is too simple !

  2. Christos Constantinou

    If the APC installation gives an error:

    apt-get install libpcre3-dev

  3. Ala ud din Jutt

    Nice post. This s useful for me.

Leave a comment

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

*