Can't install mongodb doctrine in symfony2 with composer

前端 未结 3 1047
梦如初夏
梦如初夏 2020-12-16 00:36

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.

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-16 01:22

    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!

提交回复
热议问题