How to install APC from Source – Ubuntu

In some linux distributions or in particular cases you might want to avoid installing APC using the command apc-get.

Here’s how to install it from the source code using any version you want.

0. Check the APC changelog

Go to http://pecl.php.net/package/apc and look for the desired version.

1. Uninstall a previous version

If you don’t have APC installed you can skip this step and go to the next one.

Otherwise, uninstall your current APC version from your system:

2. Download the source code

An optional step here would be to download it here:

Now proceed:

3. Run phpize

It might not be installed in your system, if so install phpize:

Now run the command:

4. Run the configure script

This command might change from one system to an other, make sure the php-config path is correct by running:

Now run or change the following command according to the previous result:

5. Compile and install the files

If it happens to return errors try installing the following package and running the commands again:

6. Edit your php.ini

The location of the file might be different, mine is:

Add the following line and save the file:

7. Restart apache and test

Restart the apache:

Create a php file in your site with the following content and look for “APC” in it:

Enjoy!

Tags: ,

No comments yet, leave yours!

Leave a Reply

Add <code> Some Code </code> by using this tags.