简体   繁体   English

PHP / CodeIgniter:如何解决mongo.so问题

[英]PHP / CodeIgniter: How to solve mongo.so problem

I have written a new PHP application with the CodeIgniter Framework. 我已经使用CodeIgniter框架编写了一个新的PHP应用程序。 Oftenly the following error is thrown: 通常会引发以下错误:

Unable to load dynamic library '/usr/lib/php/20151012/mongo.so' - /usr/lib/php/20151012/mongo.so: cannot open shared object file: No such file or directory

It is a completely fresh installation and I do not use this mongo.so library anywhere. 这是一个全新的安装,我在任何地方都不会使用此mongo.so库。 Also on the configuration of Apache or PHP I did not change anything special. 另外,在Apache或PHP的配置上,我没有进行任何特殊更改。

Probably the problem can be solved by installing php-mongodb on the system. 可能可以通过在系统上安装php-mongodb来解决该问题。 But maybe someone has a better idea to solve the problem. 但是也许有人有更好的主意来解决问题。

I got the problem solved myself. 我解决了自己的问题。

In /etc/php/7.0/mods_available was a file user.ini , which included the mongo extension. /etc/php/7.0/mods_available有一个文件user.ini ,其中包括mongo扩展名。 Don't know why, but it works now. 不知道为什么,但是现在可以了。

If you are not using MongoDB, you can safely do this 如果您不使用MongoDB,则可以放心地执行此操作

nano /etc/php/7.0/mods-available/mongodb.ini

Then, comment the line as follow 然后,如下注释该行

#extension=mongodb.so

Save with ctrl+o then exit with ctrl+x 使用ctrl + o保存,然后使用ctrl + x退出

That's it! 而已!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM