5

I want to setup MongoDbBundle with my Symfony2 app. But I getting theese error list when run composer update:

Problem 1
- doctrine/mongodb 1.0.9 requires ext-mongo >=1.2.12,<1.6-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.8 requires ext-mongo >=1.2.12,<1.6-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.7 requires ext-mongo >=1.2.12,<1.6-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.6 requires ext-mongo >=1.2.12,<1.6-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.5 requires ext-mongo >=1.2.12,<1.6-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.4 requires ext-mongo >=1.2.12,<1.6-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.3 requires ext-mongo >=1.2.12,<1.5-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.2 requires ext-mongo >=1.2.12,<1.4-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.11 requires ext-mongo >=1.2.12,<1.7-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.10 requires ext-mongo >=1.2.12,<1.7-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.1 requires ext-mongo >=1.2.12,<1.4-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.1.8 requires ext-mongo >=1.2.12,<1.7-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.1.7 requires ext-mongo >=1.2.12,<1.7-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.1.6 requires ext-mongo >=1.2.12,<1.6-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.1.5 requires ext-mongo >=1.2.12,<1.6-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb-odm 1.0.0-BETA5 requires doctrine/mongodb 1.0.0-BETA1 -> no matching package found.
- doctrine/mongodb-odm 1.0.0-BETA4 requires doctrine/mongodb 1.0.0-BETA1 -> no matching package found.
- symfony/framework-standard-edition 2.5.x-dev requires doctrine/mongodb-odm 1.0.*@beta -> satisfiable by doctrine/mongodb-odm[1.0.0-BETA10, 1.0.0-BETA11, 1.0.0-BETA12, 1.0.0-BETA4, 1.0.0-BETA5, 1.0.0-BETA6, 1.0.0-BETA7, 1.0.0-BETA8, 1.0.0-BETA9].
- doctrine/mongodb-odm 1.0.0-BETA6 requires doctrine/mongodb >=1.0.0-beta1,<1.1-dev -> satisfiable by doctrine/mongodb[1.0.0, 1.0.1, 1.0.10, 1.0.11, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.0.8, 1.0.9].
- doctrine/mongodb-odm 1.0.0-BETA7 requires doctrine/mongodb 1.0.* -> satisfiable by doctrine/mongodb[1.0.0, 1.0.1, 1.0.10, 1.0.11, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.0.8, 1.0.9].
- doctrine/mongodb-odm 1.0.0-BETA8 requires doctrine/mongodb 1.0.* -> satisfiable by doctrine/mongodb[1.0.0, 1.0.1, 1.0.10, 1.0.11, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.0.8, 1.0.9].
- doctrine/mongodb-odm 1.0.0-BETA9 requires doctrine/mongodb 1.0.* -> satisfiable by doctrine/mongodb[1.0.0, 1.0.1, 1.0.10, 1.0.11, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.0.8, 1.0.9].
- doctrine/mongodb-odm 1.0.0-BETA10 requires doctrine/mongodb >=1.1.5,<2.0 -> satisfiable by doctrine/mongodb[1.1.5, 1.1.6, 1.1.7, 1.1.8].
- doctrine/mongodb-odm 1.0.0-BETA11 requires doctrine/mongodb >=1.1.5,<2.0 -> satisfiable by doctrine/mongodb[1.1.5, 1.1.6, 1.1.7, 1.1.8].
- doctrine/mongodb-odm 1.0.0-BETA12 requires doctrine/mongodb >=1.1.5,<2.0 -> satisfiable by doctrine/mongodb[1.1.5, 1.1.6, 1.1.7, 1.1.8].
- Installation request for symfony/framework-standard-edition 2.5.x-dev -> satisfiable by symfony/framework-standard-edition[2.5.x-dev].

I found solution here, downgrade my php mongo extension update compsoer.phar but still getting same error. What I am doing wrong ?

Here is my composer.json file:

"require": {
    "php": ">=5.3.3",
    "symfony/symfony": "2.5.*",
    "doctrine/orm": "~2.2,>=2.2.3",
    "doctrine/doctrine-bundle": "~1.2",
    "twig/extensions": "~1.0",
    "symfony/assetic-bundle": "~2.3",
    "symfony/swiftmailer-bundle": "~2.3",
    "symfony/monolog-bundle": "~2.4",
    "sensio/distribution-bundle": "~3.0",
    "sensio/framework-extra-bundle": "~3.0",
    "incenteev/composer-parameter-handler": "~2.0",
    "doctrine/doctrine-fixtures-bundle": "2.2.*",
    "doctrine/migrations": "1.0.*@dev",
    "doctrine/doctrine-migrations-bundle": "2.1.*@dev",
    "hautelook/alice-bundle": "~0.2",
    "nelmio/alice": "~1.7",
    "stof/doctrine-extensions-bundle": "1.2.*@dev",
    "knplabs/knp-menu-bundle": "~2.0",
    "doctrine/mongodb-odm": "1.0.*@beta",
    "doctrine/mongodb-odm-bundle": "3.0.*@beta"
},

Edit

I even try to change "minimum-stability" property. Downgrade ext-mongo to 1.4.5 and 1.2.12 versions. Still have the same error.

SOLVING

Solve this by run in cli : sudo apt-get install php5-mongo

4
  • I think is is a simular question. stackoverflow.com/questions/20869846/… Commented Mar 12, 2015 at 14:55
  • @user3678743, i enable mongo extension in ini file Commented Mar 12, 2015 at 14:56
  • Installing php56-mongo (since i am working with php 5.6.7) worked for me. On mac with homebrew this makes it brew install php56-mongo. Took me half the day to get this working Commented Dec 4, 2015 at 15:59
  • sudo apt-get install php5-mongo solved my problem Commented May 31, 2016 at 17:14

2 Answers 2

1

are you sure you have the mongo extension ?

run this from console

 php -i | grep mongo

are there the mongo configs ?

if so add

phpinfo();

to your app/app_dev.php and check if Symfony(apache) is using another php than your shell PATH

UPDTE:

as pointed out in comments, your apache uses another php than you expect point the apache to the correct php extension path in httpd.conf

Sign up to request clarification or add additional context in comments.

5 Comments

hm... when I run sudo pecl info mongo it return result, but when run php -i | grep mongo it just thhor me to print new command...
what prints the phpinfo() in app_dev.php ? are there mongo configs ?
hm. no. there is no mongo configs. but I cant get why. I install it, enable extension in ini file.
then have a look at httpd.conf and check which php .so is included, this seems to be wrong, most likely at at /etc/apache2/httpd.conf
0

this is the solution for osx:

brew install php56-mongo

if it errors out then read the package name and re-run such as - example:

example: brew install php5789-mongo

source: http://php.net/manual/en/mongo.installation.php#mongo.installation.osx

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.