Installing APC on AWS Linux AMI

This post was published 8 years, 6 months ago. Due to the rapidly evolving world of technology, some concepts may no longer be applicable.

Update: Current versions of Amazon’s Linux AMI include the package php-pecl-apc (v3.1.9 – the same as the latest from PECL) in the repository. Using a package manager is usually preferable to using PECL- it will help you keep up to date, is centrally managed, and minimizes unnecessary dependencies (especially build tools). APC can be installed from yum via:

yum install php-pecl-apc

Definitely drove me crazy for a bit – installing APC through PECL fails, and it won’t install through yum either (for me, this was true trying to use the apc-beta, and with compiling from source). To install, first install pcre-devel, gcc, and make.

sudo yum install pcre-devel
sudo pecl install apc-beta 

If everything works out, enable APC by adding it to the PHP configuration:

echo "extension=apc.so" | sudo tee /etc/php.d/apc.ini

Finally, restart apache (or other server):

sudo service httpd restart

2 thoughts on “Installing APC on AWS Linux AMI

    • Thanks for pointing that out – PECL installations compile code so those dependencies are not unexpected. This is actually quite an old post, and current versions of Amazon’s Linux AMI include the package php-pecl-apc (v3.1.9 as of today) in the repository. I’d favour installation via yum over PECL whenever possible.

Leave a Reply

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