HOWTO: Install PECL APC Cache on CentOS (without XAMPP)

Home / Uncategorized / HOWTO: Install PECL APC Cache on CentOS (without XAMPP)

As Irakli already discussed, the Alternative PHP Cache (APC) is an op-code pre-compiler and a cache system that can boost the performance of a PHP application up to 10 times. Op-code caches are very effective for a Drupal website, since Drupal deals with large number of source files and time spent in parsing them significantly affects performance. However, if you don’t have XAMPP and need to install it on CentOS, you can follow this to get around some of the problems that happen with the default server settings.

Install Pre-reqs Using yum install the required prerequisites.

Install APC

Use the command

at this point you’ll likely see the error

Apparantly, the PECL/PEAR scripts do not use the settings from /etc/php.ini so you need to update PEAR’s memory settings to give is some more breathing room. Edit the file /usr/share/pear/pearcmd.php and add the following at the beginning:

Configure/Restart

Now configure PHP to use the new extension. Create the file /etc/php.d/apc.ini and in that file put:

Now restart apache

Maintenance

In the future, if new versions of APC are released, you can easily upgrade them using

I hope this helps!

Sign up for the Phase2 newsletter for exclusive content and news.

  • Spiri Rosetti

    It helped me. Thank you!

    You also need to have pcre-devel installed first.
    >yum install pcre-devel

  • Spiri Rosetti

    It helped me. Thank you!

    You also need to have pcre-devel installed first.
    >yum install pcre-devel