PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/redis.so' - /usr/l

今天在安装redis,swoole扩展的时候

安装完成后,查看php模块的时候,出现问题如下:

[root@localhost ~]# php -m
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/redis.so' - /usr/lib64/php/modules/redis.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/swoole.so' - /usr/lib64/php/modules/swoole.so: cannot open shared object file: No such file or directory in Unknown on line 0
[PHP Modules]
bz2
calendar
...

上面2个PHP Warning是咋回事呢,然后我又查看了php的版本:

[root@localhost ~]# php -v
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/redis.so' - /usr/lib64/php/modules/redis.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.4.16 (cli) (built: Nov  1 2019 16:04:20) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

[root@localhost /]# /usr/local/php/sbin/php-fpm -v
PHP 7.2.28 (fpm-fcgi) (built: Mar 10 2020 16:00:19)
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

2个php版本不对呀,原来是自己编译的php没有指定环境变量

vim /etc/profile
export PATH="/usr/local/php/bin:$PATH"

问题解决参考地址:https://www.cnblogs.com/two-bees/p/10730465.html

发布了4 篇原创文章 · 获赞 2 · 访问量 985
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览