2013-06-24 84 views
1

我正在尝试为MongoDB启用PHP。解决方案是相同的(首先安装php5-dev)在每个论坛,但安装失败,错误。安装MongoDB PHP驱动程序的方法

任何想法如何解决问题?

注:使用Ubuntu 12:04

[email protected]:~$ 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. 
[email protected]:~$ 

回答

2

我使用this page创建了一个新的内容sources.list,然后安装新立得软件包管理器来安装它解决了这个问题新的东西..

2

我建议这样做:

apt-get update 
apt-get upgrade 

然后安装:

apt-get install php5-cli php5-dev 

然后:

apt-get install php-pear 
pecl install mongo 
+0

“apt-get install php5-cli php5-dev”出现同样的错误。取决于这一点,取决于... – BentCoder

+0

你是否从其他仓库安装软件包? – Derick

+0

我使用apt-get来安装一些东西,而且在Linux中并不是很专业。 – BentCoder

9

假设你已经安装了MongoDB的,你可以通过这个命令安装PHP驱动程序MongoDB的

sudo apt-get install php5-mongo 
+1

对于有问题的人,至少我在13.04上做过,你可能需要先用'sudo php5enmod mongo'启用模块。 – Dan

+0

此外,该软件包仅存在于Ubuntu 12.10+ – Dan

0

这看起来不像一个问题与安装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 

你可以在这些一些更多的信息与sudo aptitude show <package>,这可能线索,你对其他已安装的软件包,他们冲突。从个人经验来看,我只需要安装build-essential包来在Ubuntu上进行任何C/C++编译。这个高层包通常最终会覆盖这些依赖关系。

3
sudo apt-get install php5-mongo 

制作PHP 5.5.9/Ubuntu的LTS 14.04

+0

我在Ubuntu 12.04上安装了PHP 5.5.16,通过PECL安装了Mongo,但它没有工作,但是它以这种方式进行安装。 – Parziphal

+0

@renicor PHP 5.5是Mongo运行的基本要求吗?让它与PHP 5.3功能? – KillABug

相关问题