The Alternative PHP Cache (APC) is a free and open opcode cache for PHP which we use within Newscoop to provide better performance. This is a mini-howto that explains how to get APC running for your Ubuntu or CentOS server. After that, you will be able to install Newscoop and enjoy.
This guide has been tested successfully on dapper and edgy.
You need the following Ubuntu packages:
If they are not present in your system, please install them. The easiest way is by running:
Installation via PECL
As of apache2, the apxs script is named differently, and pecl will fail if you do not work around this. So, you have got to provide an apxs which is just a symbolic link.
Next we use the pecl utility to download, compile and install APC.
This is a straight forward process which won't require human intervention. At the end you will have APC installed on your system. Now you need to setting it up.
All what you need to do is to add the following to the /etc/php5/apache2/php.ini file:
Usually you should add it at the end of the file.
Now, restart apache and you will be done.
I have added the extension=apc.so line to my php.ini file and restarted apache, however APC functions are not available for my PHP, what could i do?
Run phpinfo() and take a look at the extension_dir option, its value shows the full path to the PHP extensions directory, make sure your new apc.so module was stored in this directory, otherwise put it in there and restart apache.
First of all, install all needed dependencies
After that, you should be able to install APC using pecl
To configure PHP, create new file /etc/php.d/apc.ini and put the following line into it
Restart apache to make changes effective
That's all, now you should be able to use APC cache. If you will need to upgrade APC in the future, just do