• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved How to install APCu on Centos7 with Plesk Obsidian 18.0.38

elChupete

New Pleskian
Hello Boys and Girls,

I am trying to get my nextcloud running under php 8. So I installed php8 via Plesk Updater. I also installed the devel version
Code:
# yum list installed | egrep "^plesk-php[0-9]{2}-devel"
plesk-php73-devel.x86_64      1:7.3.30-1centos.7.210827.1012 @PLESK_17_PHP73   
plesk-php80-devel.x86_64      8.0.10-1centos.7.210827.1012   @PLESK_17_PHP80

I actiated PHP for my webpage and get error

Code:
Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

when I try to access my nextcloud.
When I switch back to php 7.3, everything is fine.

It looks as if nextcloud is missing APCu under php8 so I tried to install it following various explanations in this forum. But still APCu fails to install


Code:
[root@h2714647 szilz]# /opt/plesk/php/8.0/bin/pecl install apcu
PHP Warning:  PHP Startup: apcu: Unable to initialize module
Module compiled with module API=20180731
PHP    compiled with module API=20200930
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'memcached.so' (tried: /opt/plesk/php/8.0/lib64/php/modules/memcached.so (/opt/plesk/php/8.0/lib64/php/modules/memcached.so: cannot open shared object file: No such file or directory), /opt/plesk/php/8.0/lib64/php/modules/memcached.so.so (/opt/plesk/php/8.0/lib64/php/modules/memcached.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
pecl/apcu is already installed and is the same as the released version 5.1.20
install failed

So I tried to install memcached

Code:
ERROR: `/tmp/memcached/configure --with-php-config=/opt/plesk/php/8.0/bin/php-config --with-libmemcached-dir=no --with-zlib-dir=no --with-system-fastlz=no --enable-memcached-igbinary=no --enable-memcached-msgpack=no --enable-memcached-json=no --enable-memcached-protocol=no --enable-memcached-sasl=yes --enable-memcached-session=yes' failed

And now I am lost. I do not know what else to try.

I can see, that APCu is available in the php handler for php 7.3

Screenshot at Sep 05 13-05-36.png

but missing for php 8

I am lost. I do not know what I am doing wrong. Any help appreciated.
 
Installed APCU without any problems with:

# apt install plesk-php80-dev make gcc
# /opt/plesk/php/8.0/bin/pecl install apcu
# echo "extension=apcu.so" > /opt/plesk/php/8.0/etc/php.d/apcu.ini
# plesk bin php_handler --reread
# /opt/plesk/php/8.0/bin/php -m | grep apcu
apcu

And why you don't use the official Plesk Nextcloud extension Nextcloud ?
 
Thanks for reply.
These are exactly the same commands I use. (exept for I use yum instead of apt).
However when I install APCu I get

Code:
[root@h2714647 szilz]# /opt/plesk/php/8.0/bin/pecl install apcu
PHP Warning:  PHP Startup: apcu: Unable to initialize module
Module compiled with module API=20180731
PHP    compiled with module API=20200930
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'memcached.so' (tried: /opt/plesk/php/8.0/lib64/php/modules/memcached.so (/opt/plesk/php/8.0/lib64/php/modules/memcached.so: cannot open shared object file: No such file or directory), /opt/plesk/php/8.0/lib64/php/modules/memcached.so.so (/opt/plesk/php/8.0/lib64/php/modules/memcached.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
pecl/apcu is already installed and is the same as the released version 5.1.20
install failed

Regarding NExtcloud Extension:
I could, but still I do need APCu installed in order to use Caching

If I remove the caching from the config.php my existing nextcloud runs fine under php 8
 
Do you have files /opt/plesk/php/8.0/lib64/php/modules/memcached.so and /opt/plesk/php/8.0/etc/php.d/memcached.ini ?
 
hmm
I have memcached.ini
extension=memcached.so

But I don't have memcached.so in php/8.0 (I have memcache.so )

Where can I get memcached.so?
 
Ok not 100 % there yet.

# /opt/plesk/php/8.0/bin/php -m | grep apcu

shows me APCU is installed, but still I do not see it in Plesk when I go to Screenshot at Sep 07 17-17-32.png

When I activate caching in nextcloud, I am back at getting Internal Server Error Message, which tells me that APCu is not available.

What do I miss? I restarted apache and even the server
 
It seems to me more important if you see this in the output of phpinfo():

Screenshot.png
 
Does this need Nextcloud to add APCu to PHP 8?

I tried the technique IgorG posted above and got:

[root@server /]# apt install plesk-php80-dev make gcc
-bash: apt: command not found
[root@server /]# yum install plesk-php80-dev make gcc
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink | 16 kB 00:00:00
* epel: dfw.mirror.rackspace.com
PLESK_17_PHP74 | 2.9 kB 00:00:00
PLESK_17_PHP80 | 2.9 kB 00:00:00
PLESK_18_0_40-extras | 2.9 kB 00:00:00
base | 3.6 kB 00:00:00
elrepo | 3.0 kB 00:00:00
extras | 2.9 kB 00:00:00
mariadb | 3.4 kB 00:00:00
plesk-ext-grafana | 2.9 kB 00:00:00
plesk-ext-panel-migrator | 2.9 kB 00:00:00
plesk-ext-site-import | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
No package plesk-php80-dev available.
Package 1:make-3.82-24.el7.x86_64 already installed and latest version
Package gcc-4.8.5-44.el7.x86_64 already installed and latest version
Nothing to do
[root@server /]# /opt/plesk/php/8.0/bin/pecl install apcu
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading apcu-5.1.21.tgz ...
Starting to download apcu-5.1.21.tgz (92,516 bytes)
.....................done: 92,516 bytes
42 source files, building
running: phpize
sh: phpize: command not found
ERROR: `phpize' failed
[root@server /]# echo "extension=apcu.so" > /opt/plesk/php/8.0/etc/php.d/apcu.ini
[root@server /]# plesk bin php_handler --reread
The information about PHP handlers was successfully updated.
[root@server /]# /opt/plesk/php/8.0/bin/php -m | grep apcu
PHP Warning: PHP Startup: Unable to load dynamic library 'apcu.so' (tried: /opt/plesk/php/8.0/lib64/php/modules/apcu.so (/opt/plesk/php/8.0/lib64/php/modules/apcu.so: cannot open shared object file: No such file or directory), /opt/plesk/php/8.0/lib64/php/modules/apcu.so.so (/opt/plesk/php/8.0/lib64/php/modules/apcu.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[root@server /]#
 
running: phpize
sh: phpize: command not found
ERROR: `phpize' failed
Do you have file /opt/plesk/php/8.0/bin/phpize ?
If no, install plesk-php80-devel package with
Code:
# yum install plesk-php80-devel
and repeat steps from # /opt/plesk/php/8.0/bin/pecl install apcu
 
What php.ini settings are you talking about? Do you have a module loaded now or not? Check it out with the command:

# /opt/plesk/php/8.0/bin/php -m | grep apcu
 
Yes, but I cannot find any way to adjust any of the settings of the module. It is not visible in the php.ini file accessible from the control panel for PHP 8.
 
That doesn't give you direct access to the php.ini file to edit anything. It's just entering custom code for a specific domain. And the php.ini settings available in the main control panel for the entire server don't show any for APCu. Most of our domains run essentially the same PHP settings except for differences in memory (the larger domains have higher settings).
 
If you want to adjust settings for PHP8 globally, go to Tools & Settings > PHP Settings > your PHP > php.ini and add what you want there.
 
I was thinking there were some prebuilt entries in php.ini, but no matter. I found some tuneup tips so we'll see how it goes. Thanks.
 
Installed APCU without any problems with:

# apt install plesk-php80-dev make gcc
# /opt/plesk/php/8.0/bin/pecl install apcu
# echo "extension=apcu.so" > /opt/plesk/php/8.0/etc/php.d/apcu.ini
# plesk bin php_handler --reread
# /opt/plesk/php/8.0/bin/php -m | grep apcu
apcu

And why you don't use the official Plesk Nextcloud extension Nextcloud ?
Tried this with 8.1, using 2 ways to substitute.

At first line:

[root@server /]# apt install plesk-php81-dev make gcc
-bash: apt: command not found
[root@server /]# apt install plesk-php8.1-dev make gcc
-bash: apt: command not found
[root@server /]#

????
 
You have CentOS with yum package manager instead of Ubuntu/Debian with apt. In this case, the first command should be

# yum install plesk-php81-devel make gcc
 
Back
Top