2

I try to upgrade php to 8.0.1 when I finish install php and I find like that. How can I do ?

[root@localhost /]# php -v

PHP Warning: PHP Startup: Unable to load dynamic library 'redis.so' (tried: /usr/lib64/php/modules/redis.so (/usr/lib64/php/modules/redis.so: undefined symbol: _zval_ptr_dtor), /usr/lib64/php/modules/redis.so.so (/usr/lib64/php/modules/redis.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

PHP 8.0.1 (cli) (built: Jan 5 2021 13:54:54) ( NTS gcc x86_64 ) Copyright (c) The PHP Group Zend Engine v4.0.1, Copyright (c) Zend Technologies with Xdebug v3.0.2, Copyright (c) 2002-2021, by Derick Rethans

os: Centos 7

6
  • First question, is redis.so there to be loaded in any of the places PHP is looking? Second Question: If not is it somewhere else? Commented Jan 26, 2021 at 13:24
  • You are upgading to PHP8.0.1 from What version? Commented Jan 26, 2021 at 13:25
  • Is the redis server installed and running? Commented Jan 26, 2021 at 13:25
  • 3. redis server is running "[root@localhost /]# sudo systemctl status redis ● redis.service - redis-server Loaded: loaded (/etc/systemd/system/redis.service; enabled; vendor preset: disabled) Drop-In: /etc/systemd/system/redis.service.d └─limit.conf Active: active (running) since" Commented Jan 26, 2021 at 14:32
  • 2.upgrading to php 8.0.1 from 7.1.0. Commented Jan 26, 2021 at 14:34

2 Answers 2

0

I remove redis from centos 7.I'm not sure 100% correct but I didn't see "PHP Warning:".

[root@localhost ~]# sudo yum remove redisp

[root@localhost local]# rm -R redis

[root@localhost local]# cd /usr/lib64/php/modules

[root@localhost modules]# rm redis.so

[root@localhost modules]# cd /etc/php.d/

[root@localhost php.d]# rm redis.ini"

[root@localhost php.d]# php -v PHP 8.0.1 (cli) (built: Jan 5 2021 13:54:54) ( NTS gcc x86_64 ) Copyright (c) The PHP Group Zend Engine v4.0.1, Copyright (c) Zend Technologies with Xdebug v3.0.2, Copyright (c) 2002-2021, by Derick Rethans

Sign up to request clarification or add additional context in comments.

Comments

0

You possibly got this issue.

Redis extension must be loaded after json extension.

Look back to the answer you left above, the PHP warning was gone after you removed /etc/php.d/redis.ini, the point is that PHP configuration files are usually loaded in alphanumeric order. Therefore, in the scenario you described, redis.ini would be loaded before 20-json.ini which causes the issue @remicollet mentioned.

So what I recommend you do is to rename redis.ini to 50-redis.ini and restart PHP-related services.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.