今天在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]
calendar
ctype
filter
gettext
上面的意思是 :找不到扩展库的路径; 这是为什么尼?不是有的扩展库也可以出来吗?
然后我是百度上找各种答案,并不能解决我的问题,最后自己发现问题所在:
因为我并没有为所有的扩展库加了快捷链接,以为在哪里只要用 php -m 的命令就可以查看所有的扩展库。
其实是要:/usr/local/php7/bin/php -m 这个命令才可以,我的是PHP7.0版本的,其他版本自己换下这个路径就好。
如此,就可以看到所有的扩展库了:
[root@pys bin]# /usr/local/php7/bin/php -m
[PHP Modules]
bcmath
ctype
fileinfo
filter
gettext
iconv
libxml
mbstring
mcrypt
memcached
mysqli
mysqlnd
openssl
pcntl
pdo_mysql
pdo_sqlite
posix
redis
Reflection
session
shmop
SimpleXML
sockets
sqlite3
standard
swoole
sysvsem
tokenizer
xmlreader
xmlrpc
xmlwriter
[Zend Modules]
你的坚持 ------ 终将美好 ~