有的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即可。
推荐教程:PHP视频教程