APCu is an in-memory key-value store for PHP. Keys are of type string and values can be any PHP variables.
Here at Outsource Path, as part of our Server Management Services, we regularly help our customers to perform Software Installation tasks.
In this context, we shall look into the steps to install APCu cache.
To get APCu installation process started, start by logging into your Server via an SSH tool such as putty and once logged in, you need to follow the following steps;
pcre-devel package is a dependency package which is required for APCu functionality. To install this package, execute the following command;
yum install pcre-devel
Next, you also have to install EasyApache 3 and EasyApache 4.
To install APCu using PECL repository, simply run the following command;
pecl install channel://pecl.php.net/APCu-4.0.10
Also, the newer versions of APCu (Latest version is APCu 5.1.3) needs PHP 7.0.0-dev. The latest available version of PHP is PHP 5.6.19 in EasyApache 3. That’s the reason why we are installing the APCu version 4.0.10.
Please restart Apache service once the APCu installation is completed. To do this, execute;
/etc/init.d/httpd restart
If we are using multiple PHP version on EasyApache4, so we need to install APCu on each PHP version individually.
Run the following commands to install APCu module:
For PHP 5.4, execute;
/opt/cpanel/ea-php54/root/usr/bin/pecl install channel://pecl.php.net/APCu-4.0.10
Then, Verify using following command:
/opt/cpanel/ea-php54/root/usr/bin/php -m | grep apcu
For PHP 5.5, run;
/opt/cpanel/ea-php55/root/usr/bin/pecl install channel://pecl.php.net/APCu-4.0.10
Then, Verify using following command:
/opt/cpanel/ea-php55/root/usr/bin/php -m | grep apcu
For PHP 5.6, execute;
/opt/cpanel/ea-php56/root/usr/bin/pecl install channel://pecl.php.net/APCu-4.0.10
Then, Verify using following command:
/opt/cpanel/ea-php56/root/usr/bin/php -m | grep apcu
For PHP 7.0, run;
/opt/cpanel/ea-php70/root/usr/bin/pecl install apcu
Then, Verify using the following command:
/opt/cpanel/ea-php70/root/usr/bin/php -m | grep apcu
For PHP 7.1, execute;
/opt/cpanel/ea-php71/root/usr/bin/pecl install apcu
Then, Verify using the following command:
/opt/cpanel/ea-php71/root/usr/bin/php -m | grep apcu
After this process, Restart Apache service by running the command;
service httpd restart