Home >Backend Development >PHP Tutorial >Have you ever encountered php extension loading order issues?
php extension loading order problem
Some php extensions are loaded in a sequential order. If you make a mistake, the extension will not be loaded.
1. pdo_sqlsrv is a sqlserver extension. If loaded before the pdo extension, the following error will be reported.
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
Solution:
extension=pdo.so extension=pdo_sqlsrv.so //放到pdo后面
2. The swoole extension depends on the sockets extension. The following error will be reported before loading the sockets extension
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
Solution:
extension=sockets.so extension=swoole.so //放到pdo后面
After loading, restart, php-fpm will be fine
[Recommended learning: PHP video tutorial】
The above is the detailed content of Have you ever encountered php extension loading order issues?. For more information, please follow other related articles on the PHP Chinese website!