How to install APCu on Linux

Today, I will let you know how to install APC (for PHP) on a Linux system. The APC is not compatible with PHP 5.5+ version, So I’ll install and configure APCu which is supported by PHP 5.5+.

What’s APCu Cache

APC is a great op-code caching system for PHP that can help speed up your website. APC Cache helps to bypass the parsing and compiling steps and minimizes web requests to the server.

Also checkout other tutorial of PHP Cache,

Install and Configure APC Cache in Linux

Let’s download and install the APCu cache in our Linux system.

Install APC

We’ll install cache using below command:

$ sudo apt-get install php7.3-apcu -y

This command will install the latest version of APC.

Configure APC

You then configure APC, telling it where the executable file php-config is. If you don’t know where this is, then do this:

$ whereis php-config

Output:

php-config: /usr/bin/php-config /usr/share/abc/php-config.1.gz

Restart service

We’ll restart fpm and apache2 services.

sudo service php7.3-fpm restart

sudo service apache2 restart

How To Check APCu is Enable

You can check using phpinfo() output:

apcu in linux

Leave a Reply

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