Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install MongoDbBundle with Symfony2

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

like image 668
nowiko Avatar asked Nov 10 '22 17:11

nowiko


1 Answers

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

like image 92
john Smith Avatar answered Nov 15 '22 04:11

john Smith