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 [= 2.14]
Conflicts: php-xcache, php-yac
Pre-Depends: php-common [>= 2:69~]
Breaks: php-apcu [ /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:

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

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

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.

Bài mới nhất

Chủ Đề