Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I've followed the official documentation

when I run composer update I have this error : Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - 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.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-odm 1.0.0-BETA9 requires doctrine/mongodb 1.0.* -> satisfiable by doctrine/mongodb[1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4].
    - Installation request for doctrine/mongodb-odm 1.0.0-BETA9 -> satisfiable by doctrine/mongodb-odm[1.0.0-BETA9].

When I run php -m I can't find mongo extension , but the server is running and I can use Mongo in PHP, does anyone know what should the problem be ? I doubt that the doctrine can't find the mongo extension.. thanks !

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
479 views
Welcome To Ask or Share your Answers For Others

1 Answer

I fixed it ! As expected, it was because of the extension so here are the steps to take if you face the same problem as me : the requested PHP extension mongo is missing from your system.

  1. run the command : php --ini, you will see all the configuration files parsed! For me , I am using PHP-fpm , I thought the only php.ini file needed was inside fpm folder, but I was wrong there was a php.ini file inside CLI folder and it's this folder that tells the server which modules are loaded , and it's exactly the same file that doctrine reads the extensions from.
  2. Open CLI/php.ini and add this line in the end extension=mongo.so.
  3. Restart PHP : service php5-fpm restart

That's it!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...