php extension 加载顺序问题

张映 发表于 2019-08-15

分类目录: php

标签:, ,

有的php扩展,加载是有先后顺序的,如果搞错了,会导致扩展无法加载。

1,pdo_sqlsrv是sqlserver扩展,如果在pdo扩展之前加载就会报以下错误

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

解决办法:

extension=pdo.so
extension=pdo_sqlsrv.so   //放到pdo后面

2,swoole扩展依赖sockets扩展,在sockets扩展之前加载就会报以下错误

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

解决办法:

extension=sockets.so
extension=swoole.so   //放到pdo后面

加载完后,重新启动,php-fpm就好



转载请注明
作者:海底苍鹰
地址:http://blog.51yip.com/php/2171.html