PHP启动:动态库加载失败(PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/*.so')

  今天在linux上面智障一般搞了好久,本来想安装个swoole的,然后用  php -m 的命令想看下安装的PHP扩展库,发现有的扩展库有的可以出来,有的加载失败,

  加载失败的错误类型:

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/memcached.so' - /usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/memcached.so: undefined symbol: zend_new_interned_string in Unknown on line 0

  如下:

[root@pys /]# php -m
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/memcached.so' - /usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/memcached.so: undefined symbol: zend_new_interned_string in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/swoole.so' - /usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/swoole.so: undefined symbol: zend_new_interned_string in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/redis.so' - /usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/redis.so: undefined symbol: zend_new_interned_string in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/curl.so' - /usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/curl.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/local/php7/lib/php/extensions/no-debug-non-zts-20151012/fileinfo.so' - /usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/fileinfo.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/local/php7/lib/php/extensions/no-debug-non-zts-20151012/gd.so' - /usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/gd.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/local/php7/lib/php/extensions/no-debug-non-zts-20151012/json.so' - /usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/json.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/local/php7/lib/php/extensions/no-debug-non-zts-20151012/phar.so' - /usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/phar.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/local/php7/lib/php/extensions/no-debug-non-zts-20151012/zip.so' - /usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/zip.so: cannot open shared object file: No such file or directory in Unknown on line 0
[PHP Modules]
bz2
calendar
Core
ctype
date
ereg
exif
filter
ftp
gettext
gmp

 上面的意思是 :找不到扩展库的路径; 这是为什么尼?不是有的扩展库也可以出来吗?

然后我是百度上找各种答案,并不能解决我的问题,最后自己发现问题所在:

因为我并没有为所有的扩展库加了快捷链接,以为在哪里只要用  php -m 的命令就可以查看所有的扩展库。

其实是要:/usr/local/php7/bin/php  -m  这个命令才可以,我的是PHP7.0版本的,其他版本自己换下这个路径就好。

如此,就可以看到所有的扩展库了:

[root@pys bin]# /usr/local/php7/bin/php -m 
[PHP Modules]
bcmath
Core
ctype
curl
date
dom
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring
mcrypt
memcached
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
redis
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
swoole
sysvsem
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
zip
zlib

[Zend Modules]
posted @ 2017-11-29 20:42  一粒小米-博客  阅读(28524)  评论(3编辑  收藏  举报