APCu PHP extension for Plesk PHP 7

This article describes how to install the PHP APCu extension for Plesk Obsidian under Linux. A shell session under the root user is required for the installation.

Before installing PHP extensions, a server snapshot should be created so that you can undo the installation with just a few clicks in the event of an error. Server snapshots

Installation of the APCu-Extension

apt install plesk-php73-dev plesk-php74-dev zlib1g-dev gcc make

After installing the required dependencies, APCu must be installed individually for each PHP version:

/opt/plesk/php/7.3/bin/pecl install apcu
/opt/plesk/php/7.4/bin/pecl install apcu

After installation, the new extension must be added to the PHP configuration:

echo "extension=apcu.so" > /opt/plesk/php/7.3/etc/php.d/apcu.ini
echo "extension=apcu.so" > /opt/plesk/php/7.4/etc/php.d/apcu.ini

To enable the new configuration via the Plesk web interface, the PHP handlers must be reloaded:

plesk bin php_handler --reread

The affected PHP handlers must then be restarted in order to use the new APCu module:

Warning: Restarting the PHP modules will terminate and restart all running PHP processes. If the installation is carried out on a production system, we recommend making this change at night.

systemctl restart plesk-php73-fpm
systemctl restart plesk-php74-fpm