安装MongoDB PHP驱动程序的方法

Ben*_*der 1 php mongodb ubuntu-12.04

我正在尝试为Mongo DB启用PHP.解决方案是相同的(在每个论坛中首先安装php5-dev),但安装失败并出现错误.

知道怎么解决问题吗?

注意:使用Ubuntu 12:04

jojo@ubuntu:~$ sudo apt-get install php-pear php5-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php-pear : Depends: php5-cli but it is not going to be installed
 php5-dev : Depends: autoconf (>= 2.63) but it is not installable
            Depends: automake (>= 1.11) but it is not installable
            Depends: libtool (>= 2.2) but it is not installable
            Depends: shtool but it is not installable
E: Unable to correct problems, you have held broken packages.
jojo@ubuntu:~$ 
Run Code Online (Sandbox Code Playgroud)

小智 9

假设您已经安装了MongoDB,可以通过此命令为MongoDB安装PHP驱动程序

sudo apt-get install php5-mongo
Run Code Online (Sandbox Code Playgroud)