php - Symfony2, Composer ,您的 PHP 版本(5.6.18)被 "config.platform.php"版本(5.3.9)覆盖不满足要求

标签 php symfony doctrine-orm composer-php

我正在尝试将学说安装到我的项目中。我收到关于错误的 PHP 版本的错误。可以做些什么来消除这个错误的真正原因?克服它的方法是使用选项“--ignore-platform-reqs”,如 https://getcomposer.org/doc/03-cli.md#require 所述。 .

PHP版本:PHP 5.6.18

PHP 5.6.18  (cli) (built: Feb  3 2016 17:20:21)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

错误:c..>composer require doctrine/data-fixtures

Using version ^1.1 for doctrine/data-fixtures
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - doctrine/migrations v1.3.0 requires php ^5.5|^7.0 -> your PHP version (5.6
.18) overriden by "config.platform.php" version (5.3.9) does not satisfy that re
quirement.
    - doctrine/migrations v1.2.2 requires php >=5.4.0 -> your PHP version (5.6.1
8) overriden by "config.platform.php" version (5.3.9) does not satisfy that requ
irement.
    - doctrine/migrations v1.2.1 requires php >=5.4.0 -> your PHP version (5.6.1
8) overriden by "config.platform.php" version (5.3.9) does not satisfy that requ
irement.
    - doctrine/migrations v1.2.0 requires php >=5.4.0 -> your PHP version (5.6.1
8) overriden by "config.platform.php" version (5.3.9) does not satisfy that requ
irement.
    - doctrine/migrations v1.1.0 requires php >=5.4.0 -> your PHP version (5.6.1
8) overriden by "config.platform.php" version (5.3.9) does not satisfy that requ
irement.
    - doctrine/migrations v1.0.0 requires php >=5.4.0 -> your PHP version (5.6.1
8) overriden by "config.platform.php" version (5.3.9) does not satisfy that requ
irement.
    - Installation request for doctrine/migrations ~1.0 -> satisfiable by doctri
ne/migrations[v1.0.0, v1.1.0, v1.2.0, v1.2.1, v1.2.2, v1.3.0].


Installation failed, reverting ./composer.json to its original content.

composer.json的内容

"require": {
    "php": ">=5.3.9",
    "symfony/symfony": "2.8.*",
    "doctrine/orm": "^2.4.8",
    "doctrine/doctrine-bundle": "~1.4",
    "doctrine/data-fixtures" : "~1.1",
    "doctrine/doctrine-fixtures-bundle": "dev-master",

最佳答案

在你的 composer.json 的某处你有

"config": {
   "preferred-install": "dist",
   "platform": {
       "php": "5.3.9"
   }
}

该 block 将覆盖您当前的 PHP 版本,如 composer doc 中所述.

关于php - Symfony2, Composer ,您的 PHP 版本(5.6.18)被 "config.platform.php"版本(5.3.9)覆盖不满足要求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35538071/

相关文章:

php - 防止 Symfony2 内置服务器死机

mysql - 如何在学说中插入非常引用

php - 多个连接无法识别选项 "mapping_types"

javascript - 如何在管理面板中为多行添加具有批量操作(例如 CRUD)的复选框

php - 如何使用 Laravel 更新表格并添加新行?

PHP & MySQL 用户登录和权限系统

php - Symfony2 fos 在一个 View 中登录、注册和忘记密码

javascript - 使用 PHP 进行 MySQL 查询并将数据发送到 JavaScript

php - Doctrine 不会挽救一对多的关系

php - 如何在 zf2 中使用户名不区分大小写