gpt4 book ai didi

重新编译 php 后的警告 (Unable to load dynamic library & Unable to initialize module)

转载 作者:可可西里 更新时间:2023-10-31 23:50:24 27 4
gpt4 key购买 nike

重新编译 php 后,当我使用 php cli 时出现以下错误:

PHP Warning:  PHP Startup: imap: Unable to initialize module
Module compiled with module API=20050922
PHP compiled with module API=20090626
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/ldap.so' - /usr/lib/php/modules/ldap.so: undefined symbol: third_arg_force_ref in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mbstring.so' - /usr/lib/php/modules/mbstring.so: undefined symbol: second_arg_force_ref in Unknown on line 0
PHP Warning: PHP Startup: mysql: Unable to initialize module
Module compiled with module API=20050922
PHP compiled with module API=20090626
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: mysqli: Unable to initialize module
Module compiled with module API=20050922
PHP compiled with module API=20090626
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: PDO: Unable to initialize module
Module compiled with module API=20050922
PHP compiled with module API=20090626
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: pdo_mysql: Unable to initialize module
Module compiled with module API=20050922
PHP compiled with module API=20090626
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: pdo_sqlite: Unable to initialize module
Module compiled with module API=20050922
PHP compiled with module API=20090626
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mapi.so' - /usr/lib/php/modules/mapi.so: undefined symbol: fourth_arg_force_ref in Unknown on line 0

谷歌搜索后我发现模块必须更新,我试过:

pecl install <modulename>

pecl upgrade <modulename>

pear install -f pecl/<modulename>

但是我遇到了这样的错误:

configure: error: mysql_query missing!?
ERROR: `/tmp/pear/temp/PDO_MYSQL/configure' failed

或类似的错误:

make: *** [sqlite_driver.lo] 
Error 1 ERROR: `make' failed

知道如何更新模块吗?

如果在编译之前有什么我应该做的,请向我解释,因为我要在其他服务器上重新编译 php,我想在我再次遇到同样的问题之前知道解决方案。

提前致谢。

PS: 我的操作系统是 Linux (Redhat)

最佳答案

看起来您遇到的问题是您的 php 和模块 API 不同,例如:

Module compiled with module API=20050922     <----- this
PHP compiled with module API=20090626 <----- and this should match.

我通常通过从源代码编译它们来安装扩展,这似乎更可靠。

您需要使用 phpize

例如,这是我安装 APC 的方式:

wget http://pecl.php.net/get/APC-3.1.9.tgz
tar -xvzf APC-3.1.9.tgz
cd APC-3.1.9
phpize
./configure
make
sudo make install

这应该适用于所有 PECL 扩展。现在,您还有其他错误。我建议首先检查您的 php.ini 并禁用所有扩展 - 然后逐个启用并修复。

还有一个关于mysqli的错误。如果您使用的是 php >= 5.0.0,那么您需要重新编译 php(使用 ./configure [....] --with-mysqli),否则上面的过程也适用于它.

HTH

关于重新编译 php 后的警告 (Unable to load dynamic library & Unable to initialize module),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5167469/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com