gpt4 book ai didi

php - php升级到5.4.10后运行mongo.so失败

转载 作者:可可西里 更新时间:2023-11-01 09:27:37 26 4
gpt4 key购买 nike

使用 mongo 查看 php 页面时出现此错误:“无法加载 Mongo”

我的命令行是这样说的:

/usr/lib/php5/20100525# php -i | fgrep -i configure
PHP Warning: PHP Startup: mongo: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API=20100525
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/mongo.so' - /usr/lib/php5/20090626/mongo.so: cannot open shared object file: No such file or directory in Unknown on line 0

所以我确保 2009062620100525 目录都有 mongo.so 并重新启动 apache,但它仍然无法工作。我很困惑。我试过重新安装,但没有成功。

编辑:

我已确保两个目录具有相同的扩展名,现在我得到了:

PHP Warning:  PHP Startup: mongo: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API=20100525
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: mongo: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API=20100525
These options need to match
in Unknown on line 0
root@ip-172-31-16-45:/usr/lib/php5#

最佳答案

如果您升级了 PHP 二进制文件,则需要重新编译 MongoDB 驱动程序。请注意 PHP 开发 header (例如 Ubuntu 上的 php5-dev 包)应该与 PHP 二进制文件匹配(如果您只更新了二进制文件而不是开发文件)。假设你使用了 PECL,下面应该重新编译驱动程序:

$ sudo pecl install -f mongo

关于php - php升级到5.4.10后运行mongo.so失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20891054/

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