[英]Failed to run mongo.so after upgrading php to 5.4.10
I get this error when viewing a php page using mongo: "Mongo could not be loaded" 使用mongo查看php页面时出现此错误: “Mongo无法加载”
and my command line says this: 我的命令行说:
/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
So I've ensured both 20090626
and 20100525
directory have mongo.so and restarted apache but it still wont work. 所以我确保
20090626
和20100525
目录都有mongo.so并重新启动apache但它仍然无法正常工作。 I'm very confused. 我很困惑。 I've tried reinstalling with no luck.
我试过没有运气重新安装。
Edit: 编辑:
I've made sure both directories have the same extensions and now I get this: 我已经确定两个目录都有相同的扩展名,现在我得到了这个:
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#
If you've upgraded your PHP binary, you will need to re-compile the MongoDB driver. 如果您已升级PHP二进制文件,则需要重新编译MongoDB驱动程序。 Note the PHP development headers (eg
php5-dev
package on Ubuntu) should match the PHP binary (on the off chance you only updated the binary and not the development files). 注意PHP开发头文件(例如Ubuntu上的
php5-dev
软件包)应该与PHP二进制文件匹配(关于你只更新二进制文件而不是开发文件的机会)。 Assuming you used PECL, the following should recompile the driver: 假设您使用了PECL,以下应重新编译驱动程序:
$ sudo pecl install -f mongo
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.