3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

「~overriden by "config.platform.php" version (5.3.9) does not satisfy that requirement.」

Last updated at Posted at 2016-06-08

手元のマシンPHPバージョンは5.4.31(古い...)なのに、わざわざ5.3.9に上書きしてるの誰だ~と思いましたが、結論から言うと、composer.jsonのconfig.platform.phpのバージョンを正しくしてあげれば万事解決でした。

    "config": {
        "bin-dir": "bin",
        "platform": {
            "php": "5.4.31" // <--- このバージョンを読んでいる
        }
    },

先日symfony2(2.7)を手元に composerでインストールした後に、パッケージを追加してcomposer updateしましたところ、下記の様なエラーがパッケージが追加できないという目に遭いました。

d:\workspace\my_project>php composer.phar update
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
    - This package requires php >=5.4.31 but your PHP version (5.3.9) does not satisfy that requirement.
  Problem 2
    - Installation request for jms/serializer-bundle ^1.1.0 -> satisfiable by jms/serializer-bundle[1.1.0].
    - jms/serializer-bundle 1.1.0 requires php >=5.4.0 -> your PHP version (5.4.31) overriden by "config.platform.php" version (5.3.9) does not satisfy that requirement.
  Problem 3
    - doctrine/migrations v1.4.0 requires php ^5.5|^7.0 -> your PHP version (5.4.31) overriden by "config.platform.php" version (5.3.9) does not satisfy that requirement.
    - doctrine/migrations v1.3.1 requires php ^5.5|^7.0 -> your PHP version (5.4.31) overriden by "config.platform.php" version (5.3.9) does not satisfy that requirement.
    - doctrine/migrations v1.3.0 requires php ^5.5|^7.0 -> your PHP version (5.4.31) overriden by "config.platform.php" version (5.3.9) does not satisfy that requirement.
    - doctrine/migrations v1.2.2 requires php >=5.4.0 -> your PHP version (5.4.31) overriden by "config.platform.php" version (5.3.9) does not satisfy that requirement.
    - doctrine/migrations v1.2.1 requires php >=5.4.0 -> your PHP version (5.4.31) overriden by "config.platform.php" version (5.3.9) does not satisfy that requirement.
    - doctrine/migrations v1.2.0 requires php >=5.4.0 -> your PHP version (5.4.31) overriden by "config.platform.php" version (5.3.9) does not satisfy that requirement.
    - doctrine/migrations v1.1.0 requires php >=5.4.0 -> your PHP version (5.4.31) overriden by "config.platform.php" version (5.3.9) does not satisfy that requirement.
    - doctrine/migrations v1.0.0 requires php >=5.4.0 -> your PHP version (5.4.31) overriden by "config.platform.php" version (5.3.9) does not satisfy that requirement.
    - doctrine/migrations 1.4.1 requires php ^5.5|^7.0 -> your PHP version (5.4.31) overriden by "config.platform.php" version (5.3.9) does not satisfy that requirement.
    - Installation request for doctrine/migrations >=1.0.0 -> satisfiable by doctrine/migrations[1.4.1, v1.0.0, v1.1.0, v1.2.0, v1.2.1, v1.2.2, v1.3.0, v1.3.1, v1.4.0].

symfony2のcomposerインストール時に作成されたcomposer.jsonは、config.platform.php(ファイル名かと思ったらプロパティのパスだった。)が、5.3.9になっていました。このままPHP5.4.0以上を要求するパッケージをインストールしようとすると、手元のPHPバージョンは要件を満たしていても、composer.jsonに指定されたPHPバージョンが古いのでアウトになってしまうようです。

参考: http://stackoverflow.com/questions/35538071/symfony2-composer-your-php-version-5-6-18-overriden-by-config-platform-php

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?