• 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

Does Plesk affect the combination of Redis and PHP7.3?

Zoo3

Regular Pleskian
I'm looking for a solution to the problem.
I'd like to run Nextcloud on PHP 7.3. But when I use Redis with PHP 7.3, it will not work. We can not log in to Nextcloud. Listening to Nextcloud users seems to be able to use Redis on PHP7.3.

I also specified Redis for PHP's session save path. If I use APCu in Netxtcloud instead of Redis and specify the session save path locally(/var/lib/php/session), I can use Nextcloud on PHP7.3.

Even if I run Redis on flushdb/flushall, restarting the server does not change the situation.
Is this related to Plesk? If not, what is it supposed to be affecting?

I installed Redis via yum remi. And I tried updating redis with pecl.
Redis version 5.0.2. Redis updated with Pecl 4.2.0. *Originally installed was 3.0.3.
Initially I did not know how to use Redis installed with Pecl. So I installed it with yum. Is this the cause?

I'm PHP 7.2, there is no problem with using Redis and Nextcloud.

I'd really appreciate it if you could help me.

---
CentOS 7.5 / nginx 1.14.1 / Plesk 17.8.11(#35)
 
Do you have package plesk-php73-redis installed?
With command

# redis-cli monitor

you can see that Redis is work when you visit your Netxtcloud.
 
I do not understand the cause at all, but it resolved by chance.

I accidentally updated MariaDB from 10.2.20 to 10.2.21. Then I downgraded to 10.2.20 with yum downgrade. *Because other database search engine software requests 10.2.20 or earlier.
I have not changed anything else but then I tried PHP 7.3.
Then, Nextcloud worked without problems with PHP 7.3 for some reason. I got to be able to log in. I just finished logging in, so I do not know if another problem arises.
Currently when I run redis-cli monitor, redis is responding every time I operate something on Nextcloud.

Was the cause MariaDB?

>Do you have package plesk-php73-redis installed?
Code:
Package plesk-php73-redis-3.0.0-centos7.18110218.x86_64 already installed and latest version

Please tell me further.
What is Redis used for? Is Redis installed with PECL? Or Redis installed with Yum? Yum version, Pecl version, plesk-php73-redis. Each version is different.
 
What is Redis used for?
I'm not familiar with Nextcloud but according to your message, I thought that Redis is used for Nextcloud operation? Or for what purpose did you install and use it?
 
Nextcloud uses Redis for file locking. And I have specified Redis as the session_save_path on php.ini.
 
Last edited:
It's been a long time, so I write the problem I'm having.
I have a problem with specifying Redis as PHP session on PHP 7.3.3. I confirmed that there were no problems with 7.1.27 and 7.2.16. However, some people have no problem with 7.3.3. It can not always be said that there is a problem in 7.3.3. I was able to use it in PHP 7.3.1. What settings are there to change with PHP 7.3.2 later?
 
Code:
session.save_handler = redis;
session.save_path = "tcp://127.0.0.1?auth=PASS"

<?php
session_start();
echo "save_handler=" . ini_get("session.save_handler") . "\n";
echo "save_path=" . ini_get("session.save_path") . "\n";
echo "session_id=" . session_id() . "\n";
$_SESSION['libname'] = "PhpRedis";
?>
If I execute the above by PHP 7.2, each item will be displayed correctly.
However, when executed by PHP 7.3, the following error occurs.

Code:
PHP Warning:  session_start(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/session.php on line 2
PHP Warning:  session_start(): Failed to read session data: redis (path: tcp://127.0.0.1:6379?auth=PASS) in /var/session.php on line 2
PHP Fatal error:  Uncaught RedisException: Connection closed in /var/session.php:2
Stack trace:
#0 /var/session.php(2): session_start()
#1 {main}
  thrown in /var/session.php on line 2

When I change the session_path specification to a socket(/var/run/redis/redis.sock or unix:///var/run/redis/redis.sock), it changes to the following error.
Code:
PHP Fatal error:  Uncaught RedisException: Connection closed in /var/session.php on line 2

Is this a PHP 7.3.x specific issue?
 
Last edited:
I have not been able to solve this problem for a long time. There were also times when it became usable. In other words, I have not found a fundamental solution. I forgot to lock in Plesk's PHP update and automatically updated it to PHP 7.3.7.
What I learned so far. If PHP is updated, I can't use Redis for phpsession. For example, with redis-cli, I can operate with no problem in checking the basic operation of Redis.

I do not solve even if I restart the server, Redis, nginx, MariaDB, Plesk-PHP73-FPM respectively. I can not solve the same problem by running flushdb or flushall commands in Redis-cli.
I'll give up using redis for PHP session for a while. After a certain number of days, I try specifying Redis as PHP session. Then I have a high probability that Redis can be used for PHP session.
I look at the Redis-cli monitor. Then a line like "1563034841.937694 [0 tcp:127.0.0.1:6379] "AUTH" "REDIS-PASSWORD" are output. However, line containing "PHPREDIS_SESSION" are not output.

Is there no solution other than giving up Redis (session path) for a while?
 
I understood the cause of this time. This is probably limited this time.
It seems that the Pecl version redis was broken this time. When I tried trying to update redis with the pecl command, installation was started rather than "already updated". Strictly speaking, it may be a little different. An error is output like the following code and installation (build) has started.
It used to be "already updated to the latest version" before. This time, when the Pecl version of Redis has been installed, I can use it by specifying Redis as php session.

Code:
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /opt/plesk/php/7.3/share/pear/PEAR/PackageFile/v2/Validator.php on line 1933
25 source files, building
running: phpize
Configuring for:
PHP Api Version:         20180731
Zend Module Api No:      20180731
Zend Extension Api No:   320180731

What should I do to prevent Redis corruption when PHP is updated?
 
I had the exact same problem and your last message was very helpful to figure this out.

The PHP redis extension that ship with Plesk is 3.0.0. I had to manually upgrade it to 5.0.2.

Here is what I did
yum install plesk-php73-devel gcc

then I run
/opt/plesk/php/7.3/bin/pecl install redis

I ignored the error about the `continue 2` and let the compiler run.

I saved the settings for PHP one last time.

After that redis started working as normal.
 
Yesterday I encounter the exact same problem with PHP 7.3.15 and PHP 7.4.3 and Redis 5.0.7 and 4.0.14 (in each possible kombination). Only PHP 7.2.28 works as expected. Also using Redis for everything else (except session) works like a sharm. For every PHP-Version the redis-extension display Version: 3.0.0.

I have debian 9 with plesk obisian running. Perhaps the redis-extension should be updated, I guess this will hit more and more people in the future when they try to upgrade setups.
 
Yesterday I encounter the exact same problem with PHP 7.3.15 and PHP 7.4.3 and Redis 5.0.7 and 4.0.14 (in each possible kombination). Only PHP 7.2.28 works as expected. Also using Redis for everything else (except session) works like a sharm. For every PHP-Version the redis-extension display Version: 3.0.0.

I have solved this problem by uninstalling redis once with pecl and installing redis again with pecl as one of the solutions.
 
I can stick at 7.2.28 for a while and hope there will be a fix from plesk itself (because the potential of breaking many installations while upgrading should be a big problem).
 
Back
Top