【发布时间】:2016-06-14 19:41:13
【问题描述】:
我已经在 ubuntu 16.04 安装了 php7.0 我安装了驱动程序,如下所示http://php.net/manual/en/mongodb.installation.manual.php
$ git clone https://github.com/mongodb/mongo-php-driver.git
$ cd mongo-php-driver
$ git submodule sync && git submodule update --init
$ phpize
$ ./configure
$ make all -j 5
$ sudo make install
当我尝试从浏览器打开rockmongo时,它显示
To make things right, you must
install php_mongo module. Here for installation documents on PHP.net.
同样在rockmongo的index.php中,我放了die,发现
这条线
if (!class_exists("Mongo") && !class_exists("MongoClient"))
返回错误
sudo pecl 搜索 mongo 返回
Retrieving data...0%
.Matched packages, channel pecl.php.net:
=======================================
Package Stable/(Latest) Local
mongo 1.6.14 (stable) MongoDB database driver
mongodb 1.1.7 (stable) MongoDB driver for PHP
我还包含了 php.ini 的扩展名
也做了
sudo service apache2 restart
我跑了sudo pecl install mongodb
给出了这个结果
Build process completed successfully
Installing '/usr/lib/php/20151012/mongodb.so'
install ok: channel://pecl.php.net/mongodb-1.1.7
configuration option "php_ini" is not set to php.ini location
You should add "extension=mongodb.so" to php.ini
怎么办?
【问题讨论】: