Solution to the problem of extension loading order in PHP

王林
Release: 2023-04-07 18:50:01
Original
1880 people have browsed it

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

Solution:

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

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

Solution:

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

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!

Related labels:
source:php.cn
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 [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!