Home>Article>Backend Development> Solution to the problem of extension loading order in PHP
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. If loaded before the sockets extension, the following error will be reported:
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后面
Restart php-fpm after loading.
Recommended tutorial:PHP video tutorial
The above is the detailed content of Solution to the problem of extension loading order in PHP. For more information, please follow other related articles on the PHP Chinese website!