我已经安装了MongoDB PHP lib
但尽管如此,我无法连接到MongoDB数据库
rockmonogo的错误:
To make things right, you must install php_mongo module. Here for installation documents on PHP.net.
phpmoadmin的错误:
PHP cannot access MongoDB, you need to install the Mongo extension for PHP.
使用Jenssegers \ Mongodb lib的Laravel错误:
Unsupported driver [mongodb]
答案 0 :(得分:0)
确保它实际上已正确安装。您收到的错误似乎表明您的环境无法找到扩展程序。我已经为你编译了安装说明。
wget http://pear.php.net/go-pear.phar
php go-pear.phar
sudo pecl install mongodb
。extension=mongodb.so
添加到 php.ini 文件。/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
来安装自制程序。brew update
brew tap homebrew/php
brew install php54-mongodb
brew install php55-mongodb
brew install php56-mongodb
brew install php70-mongodb
extension=php_mongodb.dll
添加到 php.ini 文件。答案 1 :(得分:0)
对于Mac系统,不建议使用自制的php点击机制,它将无法正常工作。您需要手动安装它,或者需要安装包含所有内置软件包的Ampps。
使用新版本的系统的用户可能会抛出以下错误
Error: homebrew/php was deprecated. This tap is now empty as all its formulae were migrated.