1

我正在尝试为 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:~$ 
4

6 回答 6

9

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

sudo apt-get install php5-mongo
于 2013-06-24T14:00:32.993 回答
3
sudo apt-get install php5-mongo

在 PHP 5.5.9 / Ubuntu 14.04 LTS 上工作

于 2014-05-15T19:55:17.887 回答
2

I would suggest to do this:

apt-get update
apt-get upgrade

And then install:

apt-get install php5-cli php5-dev

And then:

apt-get install php-pear
pecl install mongo
于 2013-06-24T08:30:23.123 回答
2

我为sources.list使用此页面创建了一个新内容,然后安装了 Synaptic 包管理器来安装解决问题的新内容..

于 2013-06-25T12:26:21.453 回答
0

这似乎不太像是安装的问题php5-dev,甚至是 mongo 扩展,更多的是以下冲突:

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

您可以使用 获得更多关于这些的信息sudo aptitude show <package>,这可能会提示您了解与它们冲突的其他已安装包。根据个人经验,我只需要安装该build-essential软件包即可在 Ubuntu 上进行任何 C/C++ 编译。该高级包通常最终会覆盖这些依赖项。

于 2013-06-24T14:45:34.470 回答
0

http://docs.mongodb.org/ecosystem/drivers/php/

此链接提供了我们需要为不同操作系统执行的所有命令,以安装 mongoDb 的 php 驱动程序

于 2015-04-05T05:11:49.107 回答