SoFunction
Updated on 2025-04-04

Solve the issue of loading order of php extension

For some php extensions, the loading sequence is in order. If you make a mistake, the extension will not be loaded.

1. pdo_sqlsrv is a sqlserver extension. If it is 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. (/usr/lib64/php/modules/pdo_sqlsrv.: undefined symbol: php_pdo_register_driver)) in Unknown on line 0

Solution:

extension=
extension=pdo_sqlsrv.so  //Put it inpdolater

2. Swoole extension depends on sockets extension. If the sockets extension is loaded before sockets extension, the following error will be reported.

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

Solution:

extension=
extension=  //Put it inpdolater

After loading, restart and php-fpm is fine

Summarize

The above is the solution to the loading order of php extension that the editor introduced to you. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support for my website!
If you think this article is helpful to you, please reprint it. Please indicate the source, thank you!