Since this is NPR better to keep it internal
Applicable to:
- Plesk for Linux
Question
How to install APCu PHP module for Plesk PHP?
Answer
Warning: APCu is not officially supported by Plesk and was not tested extensively. Use the instructions below at your own risk.
-
Connect to the server via SSH.
-
Install required development packages:
-
For .deb-based OS (Ubuntu, Debian):
# apt install plesk-php80-dev zlib1g-dev gcc make
-
For .rpm-based OS (CentOS, RHEL, CloudLinux):
# yum install plesk-php80-devel zlib-devel gcc make
Note: As an example, Plesk PHP 7.0 development package is installed. For a different version of PHP change
php80
to the required version, for instance,php70
,php56
-
-
Install the APCu PHP module:
-
For Plesk PHP 5.x:
# /opt/plesk/php/5.x/bin/pecl install apcu-4.0.11
-
For Plesk PHP 7.x::
# /opt/plesk/php/7.x/bin/pecl install apcu
-
-
- For Plesk PHP 8.x
# /opt/plesk/php/8.x/bin/pecl install apcu
- For Plesk PHP 8.x
-
Enable APCu in PHP configuration:
# echo "extension=apcu.so" > /opt/plesk/php/8.0/etc/php.d/apcu.ini
-
Restart PHP service and refresh PHP handlers information:
# service plesk-php80-fpm restart
# plesk bin php_handler --reread
-
Verify that the module is loaded and is working:
# /opt/plesk/php/8.0/bin/php -i | grep apc.enabled
apc.enabled => On => OnTo check whether APCu is enabled, open the php_info() page and find the following content:
Comments
13 comments
Hi,
i've got this error, if i try to install APCu in CentOS7:
[root@server ~]# /opt/plesk/php/7.2/bin/pecl install apcu
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-upd ate pecl.php.net" to update
downloading apcu-5.1.12.tgz ...
Starting to download apcu-5.1.12.tgz (105,890 bytes)
........................done: 105,890 bytes
39 source files, building
running: phpize
Configuring for:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
Enable internal debugging in APCu [no] : no
building in /tmp/pear-build-rootSxUmme/apcu-5.1.12
running: /tmp/apcu/configure --with-php-config=/usr/bin/php-config --enable-apcu -debug=no
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... no
checking for gcc... no
configure: error: in `/tmp/pear-build-rootSxUmme/apcu-5.1.12':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
ERROR: `/tmp/apcu/configure --with-php-config=/usr/bin/php-config --enable-apcu- debug=no' failed
Can anyone help? :)
Hello @Dennis,
The main error message part here is "configure: error: no acceptable C compiler found in $PATH".
It means either you don't have gcc installed or it's not in your $PATH variable.
To install gcc use this: (run as root)
hi
In second point,
Is this correct "plesk-php70-dev"
Since I am getting error "unable to locate package plesk-php70-dev"
My current php version is 5.6.37 in plesk for websites.
Hello @surech C,
As it is written in note for this article "As an example, Plesk PHP 7.0 development package is installed. For a different version of PHP change
php70
to the required version, for instance,php56
".In case you need to install the module for PHP 5.6, install package "plesk-php56-devel" instead of "plesk-php70-devel".
Thanks for the reply.
I entered root via ssh
and typed 'plesk' to manage server.
I typed
# apt install plesk-php-56dev zlib1g-dev gcc
I am getting error unable to locate package zlib1g
@suresh C, please, let me know OS version you use.
hi Ivan
The OS is ubuntu 16.04.5 LTS
I did these after ssh login
Now working fine after putting 1 in zlib1g
# apt install plesk-php-56dev zlib1g-dev gcc
Given apcu full compatibilty-yes
given internal debugging-no
Tried 5th point, its not working. (Replaced php70 with php56) to restart.
7th point is working apcu-enabled
@suresh C, thank you for sharing
Hi there,
great tutorial, but I needed to install
first, in order to work properly.
thanks.
Hi guys,
i've a problem with php 7.3
With php7.2 i've no problem
Someone can help me?
Hello @Carlo Angeletti,
The error reported caused by missing package plesk-php73-dev. Please install the package:
For Ubuntu, Debian:
# apt install plesk-php73-dev zlib1g-dev gcc
For CentOS, RHEL:
# yum install plesk-php73-devel zlib-devel gcc
After this step, proceed with the module installation.
Please sign in to leave a comment.