首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >PHP,您的Symfony2版本(5.6.18)被"config.platform.php“版本(5.3.9)覆盖不符合要求

PHP,您的Symfony2版本(5.6.18)被"config.platform.php“版本(5.3.9)覆盖不符合要求
EN

Stack Overflow用户
提问于 2016-02-21 23:38:29
回答 3查看 30K关注 0票数 41

我正试图在我的项目中加入原则。我得到关于错误的PHP版本的错误。可以做些什么来消除此错误的真正原因?克服它的方法是使用https://getcomposer.org/doc/03-cli.md#require中描述的"--ignore-platform-reqs“选项。

PHP版本: PHP 5.6.18

代码语言:javascript
复制
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需要规则/数据装置

代码语言:javascript
复制
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的内容

代码语言:javascript
复制
"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",
EN

回答 3

Stack Overflow用户

发布于 2016-02-21 23:45:49

在你的composer.json中的某个地方

代码语言:javascript
复制
"config": {
   "preferred-install": "dist",
   "platform": {
       "php": "5.3.9"
   }
}

该代码块会覆盖您当前的PHP版本,如composer doc中所述。

票数 108
EN

Stack Overflow用户

发布于 2016-02-21 23:43:54

在composer.json中,删除以下行:

代码语言:javascript
复制
// ...
"config": {
    "platform": {
        "php": "5.3.9"
    }
},
// ...

参见platform config in composer

票数 45
EN

Stack Overflow用户

发布于 2016-02-29 04:55:00

我使用Symfony 2.7的理论迁移

在我的composer.json中,我注意到你没有,你可以试着添加它

代码语言:javascript
复制
"doctrine/doctrine-migrations-bundle": "^1.0"

我根据Symfony2文档手动安装了迁移,您可以在here中阅读它。

这是我完整的2.7symfony作曲家:

代码语言:javascript
复制
"require": {
    "php": ">=5.3.9",
    "symfony/symfony": "2.7.*",
    "doctrine/orm": "~2.2,>=2.2.3,<2.5",
    "doctrine/dbal": "<2.5",
    "doctrine/doctrine-bundle": "~1.4",
    "symfony/assetic-bundle": "~2.3",
    "symfony/swiftmailer-bundle": "~2.3",
    "symfony/monolog-bundle": "~2.4",
    "sensio/distribution-bundle": "~4.0",
    "sensio/framework-extra-bundle": "~3.0,>=3.0.2",
    "incenteev/composer-parameter-handler": "~2.0",
    "friendsofsymfony/user-bundle": "1.3.*@dev",
    "ircmaxell/password-compat": "^1.0",

    "sonata-project/block-bundle": "2.3.*@dev",
    "sonata-project/easy-extends-bundle": "^2.1",
    "sonata-project/datagrid-bundle": "~2.2@dev",
    "sonata-project/admin-bundle": "~2.3@dev",
    "sonata-project/doctrine-orm-admin-bundle": "~2.3@dev",
    "sonata-project/user-bundle": "~2.3@dev",
    "doctrine/doctrine-migrations-bundle": "^1.0"

},
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35538071

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档