Install apcu php 7.4 ubuntu

← ServerPilot Docs

In the examples shown, replace "X.Y" with your app's PHP version (for example, "5.6" or "7.1").

The APCu extension adds object caching functions to PHP.

APCu is the official replacement for the outdated APC extension. APC provided both opcode caching (opcache) and object caching. As PHP versions 5.5 and above include their own opcache, APC was no longer compatible, and its opcache functionality became useless. The developers of APC then created APCu, which offers only the object caching functionality (they removed the outdated opcache).

Installing APCu on PHP 7.0, 7.1, 7.2, 7.3, and 7.4

To install this extension on PHP 7.X, SSH in to your server as root and run these commands:

sudo apt-get -y install gcc make autoconf libc-dev pkg-config
sudo pecl7.X-sp install apcu

When asked the following question, press Enter.

Enable internal debugging in APCu [no] :

Once installed, create a configuration file for the extension and restart PHP by running the following commands as root

sudo bash -c "echo extension=apcu.so > /etc/php7.X-sp/conf.d/apcu.ini"
sudo service php7.X-fpm-sp restart

APCu for PHP 7+ does not support an option for full backwards compatibility with APC. If you require full backwards compatibility with APC and you're using PHP 7+, you'll also need to install the APCu Backwards Compatibility (apcu-bc) extension.

Installing APCu on PHP 5.4, 5.5, and 5.6

To install this extension on PHP 5.X, SSH in to your server as root and run these commands:

sudo apt-get -y install gcc make autoconf libc-dev pkg-config
sudo pecl5.X-sp install apcu-4.0.11

When asked the following questions, press Enter.

Enable full APC compatibility [yes] :
Enable internal debugging in APCu [no] :

Once installed, create a configuration file for the extension and restart PHP by running the following command as root:

sudo bash -c "echo extension=apcu.so > /etc/php5.X-sp/conf.d/apcu.ini"
sudo service php5.X-fpm-sp restart

Verifying the Installation

You can verify APCu is installed correctly by running the command:

phpX.Y-sp -i | grep apcu

You should see output like the following:

Additional .ini files parsed => /etc/phpX.Y-sp/conf.d/apcu.ini,
apcu

Uninstalling the APCu Extension

To uninstall this extension, as root run the commands:

sudo rm /etc/phpX.Y-sp/conf.d/apcu.ini
sudo peclX.Y-sp uninstall apcu

Next, restart PHP-FPM with the command:

sudo service phpX.Y-fpm-sp restart

Last updated: October 8, 2018

1. Install php7.4-apcu package

Learn how to install php7.4-apcu package:

sudo apt install php7.4-apcu

2. Uninstall / Remove php7.4-apcu package

Please follow the step by step instructions below to uninstall php7.4-apcu package:

sudo apt remove php7.4-apcu

sudo apt autoclean && sudo apt autoremove

3. Details of php7.4-apcu package

Package: php7.4-apcu
Source: php-apcu
Priority: optional
Section: php
Installed-Size: 177
Maintainer: Debian PHP PECL Maintainers


Architecture: amd64
Version: 5.1.21+4.0.11-8+ubuntu20.04.1+deb.sury.org+1
Replaces: php-apcu (<< 5.1.21+4.0.11-8+ubuntu20.04.1+deb.sury.org+1~)
Suggests: php-gd
Provides: php-apcu
Depends: php7.4-common, phpapi-20190902, libc6 (>= 2.14)
Conflicts: php-xcache, php-yac
Pre-Depends: php-common (>= 2:69~)
Breaks: php-apcu (<< 5.1.21+4.0.11-8+ubuntu20.04.1+deb.sury.org+1~)
Filename: pool/main/p/php-apcu/php7.4-apcu_5.1.21+4.0.11-8+ubuntu20.04.1+deb.sury.org+1_amd64.deb
Size: 45036
MD5sum: a4881ba49f092ccf064ebdd4ede600b1
SHA1: 604479a0b689ccb0e9fdb98c7c833282f6cc0acc
SHA256: 2cf1d46f91e444f51dfc10ffed979469d466025f9bde2334e09f7f36398a7f9c
Description: APC User Cache for PHP
Description-md5: 0d7462c8f566c71b65f0d4bcf7806445

First, I'm assuming you installed PHP7 using the DotDeb APT Repository. If not, this is how you should install it.

Once PHP7 is installed and working properly, and assuming there are no other versions of PHP installed on the system, install apcu via:

sudo apt-get install php7.0-dev
pecl channel-update pecl.php.net
pecl install apcu

echo "extension=apcu.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`

Just press enter if prompted to specify any configuration.

answered Jan 3, 2016 at 8:13

Install apcu php 7.4 ubuntu

WillWill

23.1k13 gold badges93 silver badges105 bronze badges

4

I know that this post is old but I would like to contrib with the way that works for me, because I tried the three answers in this question and I couldn't install APCU successfully. My problem with the answers wasn't the installation of APCU, pecl install apcu works and installed it. But I try to add the extension line in php.ini following each method, but neither of them works for me. I checked in a php file with phpinfo() and it always didn't show the APCU as installed extension.

After research more in the search results I found a easy way to install it in WPBullet. What I did was to install the packages php-apcu and php-apcu-bc with:

sudo apt-get install php7.0-apcu

This works for me without manual writting in php.ini. Don't forget to restart apache2, or whatever you have as server.

answered Oct 11, 2017 at 10:34

Install apcu php 7.4 ubuntu

IvanhercazIvanhercaz

6621 gold badge10 silver badges29 bronze badges

4

Run :

sudo apt-get install php7.0-dev
pecl channel-update pecl.php.net
pecl install apcu

Do not immediately add extension=apcu.so on php.ini without checking. extension=apcu.so should automatically get added on /etc/php/7.0/cli/conf.d/20-apcu.ini. You can run php -i | grep app to check or cat /etc/php/7.0/cli/conf.d/20-apcu.ini. If you load twice, you'll get :

PHP Warning:  Module 'apcu' already loaded in Unknown on line 0

This message is probably kept for older system :

install ok: channel://pecl.php.net/apcu-5.1.5
configuration option "php_ini" is not set to php.ini location
You should add "extension=apcu.so" to php.ini

I can not comment on the existing answer (point is less than 50). I got that PHP error, then found that file.

answered Sep 19, 2016 at 3:31

Check /etc/php/(version like 7.2)/cli/conf.d directory and find 20-apcu.ini. If you dont see it there, You need to install it. To install follow bellow command:

sudo apt-get install php7.2-apcu

Now add bellow line in php.ini file if it is not there.

extension=apcu.so

Notice: for php7.2-apcu use your own php version. for example php7.0-apcu

After install restart your php7.X-fpm service if you are using nginx

sudo service php7.2-fpm restart

Now reload nginx

sudo service nginx reload

or reload apache, if you are using it:

sudo service apache2 reload

answered Dec 10, 2018 at 17:23

Install apcu php 7.4 ubuntu

Just installed APCu on a Ubuntu 14.04.3 LTS with PHP 7.0.3-2:

$ pecl install apcu
$  cat > /etc/php/mods-available/test.ini
; configuration for php apcu module
; priority=20
extension=apcu.so
$ ln -s /etc/php/mods-available/apcu.ini /etc/php/7.0/fpm/conf.d/20-apcu.ini
$ service php7.0-fpm restart

phpinfo() output:

Install apcu php 7.4 ubuntu

answered Oct 30, 2016 at 9:55

automatixautomatix

13k24 gold badges98 silver badges220 bronze badges

I use Ubuntu 20.04 and php-fpm 7.4. To install apcu:

apt install php-apcu

answered Jan 16, 2021 at 9:53

Install apcu php 7.4 ubuntu

MawanMawan

836 bronze badges

1

for PHP7.3 use following commands

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

sudo service php7.3-fpm restart

sudo service apache2 restart

answered Mar 10, 2021 at 10:29

Install apcu php 7.4 ubuntu

How to install APCu extension in php?

How to Install APCu on PHP 7.0, 7.1, 7.2 ?.
sudo apt-get -y install gcc make autoconf libc-dev pkg-config..
# Replace X with your php version number sudo pecl7.X-sp install apcu..
# Hit Enter in response to this question Enable internal debugging in APCu [no] :.

How do I install APCu cache?

Just follow these steps:.
Step 1 : Login to Server. At first, we need to login to our server via SSH. ... .
Step 2 : Install APCu. ... .
Step 3 : Dependency Packages for APCu. ... .
Step 4 : Restart Web Server. ... .
Step 5 : APCu Admin Page. ... .
Step 6 : Config APCu. ... .
Step 7 : Store and Fetch Data..

What is APCu extension?

The APCu extension adds object caching functions to PHP. APCu is the official replacement for the outdated APC extension. APC provided both opcode caching (opcache) and object caching. As PHP versions 5.5 and above include their own opcache, APC was no longer compatible, and its opcache functionality became useless.

What is APCu cache?

APCu is a user-accessible PHP cache. Pantheon provides APCu by default across all plans, but the size of the APCu memory cache (apc. shm_size) varies depending on the service level. See the Application Containers overview to learn more about APCu on Pantheon's container architecture.