BlissOfBeing TechBlog

Front-end for dinner with some back-end for dessert

How to Install APC on a Fresh Ubuntu Install

APC speeds up PHP, and will be built into php6. But before then here is how to install APC on a freshly installed Ubuntu box:

1
2
3
4
5
6
7
8
9
10
apt-get update
apt-get install libpcre3-dev #an APC dependency
apt-get install php5-cli
apt-get install php5-dev
wget http://pear.php.net/go-pear.phar #downloading pear, the php package manager
php go-pear.phar #installing pear
pecl install apc
vim /etc/php5/apache2/php.ini #edit your php.ini and add extension=apc.so
/etc/init.d/apache2 restart #restart apache to reload your php.ini file

test by running <?php phpinfo(); ?>

APC is installed. Enjoy your speedup.