重新编译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)
答案 0 :(得分:0)
看起来您遇到的问题是您的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&gt; = 5.0.0,那么您需要重新编译php(使用./configure [....] - with-mysqli),否则上面的过程应该适用于它好。
HTH