0

电脑: 2009 年中 Mac Book Pro 和 OSX Lion

嗨,我目前在安装 Symfony2 时遇到问题。

我正在和一些朋友一起做一个 Symfony2 协作项目,我们正在使用 composer 和 git 来协调我们所有的工作。话虽如此,我通常使用作曲家来获取我需要的任何东西,并且没有任何问题。

然而,他们最近开始使用 MongoDB 以及 php 使用的 MongoDB 扩展(和 Symfony2),当我使用 Composer 更新时,这就是控制台“吐出”的内容

composer update
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - doctrine/mongodb-odm-bundle 3.0.x-dev requires doctrine/mongodb-odm >=1.0.0-beta5,<1.1-dev -> satisfiable by doctrine/mongodb-odm 1.0.0-BETA5, doctrine/mongodb-odm 1.0.0-BETA6, doctrine/mongodb-odm 1.0.0-BETA7, doctrine/mongodb-odm 1.0.x-dev.
    - doctrine/mongodb-odm-bundle v3.0.0-BETA1 requires doctrine/mongodb-odm 1.0.0-BETA5 -> satisfiable by doctrine/mongodb-odm 1.0.0-BETA5.
    - doctrine/mongodb-odm-bundle v3.0.0-BETA2 requires doctrine/mongodb-odm >=1.0.0-beta5,<1.1-dev -> satisfiable by doctrine/mongodb-odm 1.0.0-BETA5, doctrine/mongodb-odm 1.0.0-BETA6, doctrine/mongodb-odm 1.0.0-BETA7, doctrine/mongodb-odm 1.0.x-dev.
    - doctrine/mongodb-odm-bundle v3.0.0-BETA3 requires doctrine/mongodb-odm >=1.0.0-beta5,<1.1-dev -> satisfiable by doctrine/mongodb-odm 1.0.0-BETA5, doctrine/mongodb-odm 1.0.0-BETA6, doctrine/mongodb-odm 1.0.0-BETA7, doctrine/mongodb-odm 1.0.x-dev.
    - doctrine/mongodb-odm 1.0.0-BETA6 requires doctrine/mongodb >=1.0.0-beta1,<1.1-dev -> satisfiable by doctrine/mongodb 1.0.0, doctrine/mongodb 1.0.0-BETA1, doctrine/mongodb 1.0.0-BETA2, doctrine/mongodb 1.0.0-BETA3.
    - doctrine/mongodb-odm 1.0.0-BETA7 requires doctrine/mongodb 1.0.* -> satisfiable by doctrine/mongodb 1.0.0, doctrine/mongodb 1.0.0-BETA1, doctrine/mongodb 1.0.0-BETA2, doctrine/mongodb 1.0.0-BETA3.
    - doctrine/mongodb-odm 1.0.x-dev requires doctrine/mongodb 1.0.* -> satisfiable by doctrine/mongodb 1.0.0, doctrine/mongodb 1.0.0-BETA1, doctrine/mongodb 1.0.0-BETA2, doctrine/mongodb 1.0.0-BETA3.
    - doctrine/mongodb-odm 1.0.0-BETA5 requires doctrine/mongodb 1.0.0-BETA1 -> satisfiable by doctrine/mongodb 1.0.0-BETA1.
    - doctrine/mongodb 1.0.0-BETA3 requires ext-mongo >=1.3.1,<1.4-dev -> the requested PHP extension mongo is missing from your system.
    - doctrine/mongodb 1.0.0-BETA2 requires ext-mongo >=1.2.12,<1.3-dev -> the requested PHP extension mongo is missing from your system.
    - doctrine/mongodb 1.0.0 requires ext-mongo >=1.2.12,<1.4-dev -> the requested PHP extension mongo is missing from your system.
    - doctrine/mongodb 1.0.0-BETA1 requires ext-mongo * -> the requested PHP extension mongo is missing from your system.
    - Installation request for doctrine/mongodb-odm-bundle 3.0.* -> satisfiable by doctrine/mongodb-odm-bundle 3.0.x-dev, doctrine/mongodb-odm-bundle v3.0.0-BETA1, doctrine/mongodb-odm-bundle v3.0.0-BETA2, doctrine/mongodb-odm-bundle v3.0.0-BETA3.

这是说我的系统上不存在 ext-mongo 并且它丢失了,但是当我执行命令时php -m

php -m
[PHP Modules]
Core
ctype
date
dom
ereg
fileinfo
filter
hash
iconv
json
libxml
mongo
pcre
PDO
pdo_sqlite
Phar
posix
Reflection
session
SimpleXML
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter

[Zend Modules]

不用说,在正确的 php.ini 文件中启用了 extension=mongo.so。

我什么都试过了,brew,ports,pecl,pear....有什么建议吗?我正处于严密的封锁状态。

4

2 回答 2

3

如果你有 brew

安装 php-mongo

brew install php56-mongo << i am using php 5.6

重启php

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.php56.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php56.plist

再做作曲家

composer update doctrine/mongodb-odm doctrine/mongodb-odm-bundle
于 2015-04-15T10:56:24.697 回答
0

如果您使用的是 MAMP,这可能是因为只有一个 php.ini 文件被更改为包含 mongo 扩展名。进入path\to\bin\apache\bin\php.ini并确保您已将 mongo 添加到动态扩展列表中。

您还需要确保 mongo 二进制文件位于默认扩展文件夹中,并且它也已添加php.inipath\to\bin\php\php5\php.ini.

于 2013-06-09T04:20:53.333 回答