Home > Backend Development > PHP Tutorial > Have you ever encountered php extension loading order issues?

Have you ever encountered php extension loading order issues?

藏色散人
Release: 2023-04-09 19:54:01
forward
2981 people have browsed it

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
Copy after login

Solution:

extension=pdo.so  
extension=pdo_sqlsrv.so   //放到pdo后面
Copy after login

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
Copy after login

Solution:

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

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!

Related labels:
php
source:51yip
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template