无法在symfony2中使用composer安装mongodb doctrine [英] Can't install mongodb doctrine in symfony2 with composer

查看:515
本文介绍了无法在symfony2中使用composer安装mongodb doctrine的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已遵循官方文档

当我运行composer更新我有这个错误:
您的需求无法解析到一个可安装的软件包。

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].

当我运行 php -m 找到mongo扩展,但服务器正在运行,我可以在PHP中使用Mongo,有谁知道什么问题应该是什么?
我怀疑这个原则找不到mongo扩展名..
谢谢!

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 !

推荐答案

我修复了它!
如预期的那样,这是因为扩展,所以这里是采取的步骤,如果你面临与我一样的问题:所请求的PHP扩展mongo从您的系统中丢失。


  1. 运行命令: php --ini 所有的配置文件解析!对我来说,我使用PHP-fpm,我认为唯一需要的php.ini文件是在fpm文件夹内,但我错了在CLI文件夹中有一个php.ini文件,它是这个文件夹告诉服务器哪些模块加载

  2. 打开CLI / php.ini并将此行添加到结尾 extension = mongo.so

  3. 重新启动PHP: service php5-fpm restart

  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

就是这样!

这篇关于无法在symfony2中使用composer安装mongodb doctrine的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆