Help us understand the problem. What is going on with this article?

PHP5.3のcomposerでguzzleのインストールに失敗するようになった話

More than 1 year has passed since last update.

2018/11/1にcomposerのVersion 1.7.3がリリースされました。
https://github.com/composer/composer/blob/master/CHANGELOG.md
composer.pharをself-updateすると、Version 1.7.3となります。(※2018/12/7現在は1.8.0)

$ php composer.phar self-update
Updating to version 1.7.3 (stable channel).
   Downloading (100%)
Use composer self-update --rollback to return to version 1.4.1

しかし、この環境でcomposer install を行うと、guzzleライブラリのインストールに失敗するようになりました。(PHP 5.3.27の環境で確認)

$ php composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: remove guzzle/guzzle v3.9.3
    - don't install guzzle/guzzle v3.9.3|remove guzzlehttp/guzzle v3.8.1
    - don't install guzzlehttp/guzzle v3.8.1|don't install guzzle/guzzle v3.9.3
    - Installation request for guzzle/guzzle v3.9.3 -> satisfiable by guzzle/guzzle[v3.9.3].
    - Installation request for guzzlehttp/guzzle v3.8.1 -> satisfiable by guzzlehttp/guzzle[v3.8.1].

そして、composer updateも失敗。
AWS SDKがguzzleに依存しているので使わないわけには行きません。

$ php composer.phar config -g repositories.packagist composer 'https://packagist.jp'
$ php -d memory_limit=4096M 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
    - Conclusion: remove aws/aws-sdk-php 2.8.31
    - Conclusion: don't install aws/aws-sdk-php 2.8.31
    - Conclusion: don't install guzzlehttp/guzzle v3.8.1|keep guzzle/guzzle v3.9.3
    - Conclusion: don't install aws/aws-sdk-php 2.8.31|remove guzzlehttp/guzzle v3.8.1|keep guzzle/guzzle v3.9.3
    - aws/aws-sdk-php 2.4.0 requires guzzle/guzzle ~3.7.0 -> satisfiable by guzzle/guzzle[v3.7.0, … v3.7.4].

    - aws/aws-sdk-php 2.8.29 requires guzzle/guzzle ~3.7 -> satisfiable by guzzle/guzzle[v3.9.3, … v3.9.2].

    - aws/aws-sdk-php 2.0.0 requires guzzle/guzzle 3.0.* -> satisfiable by guzzle/guzzle[v3.0.0, … v3.0.7].
    - don't install guzzlehttp/guzzle v3.8.0|don't install guzzle/guzzle v3.7.0

    - don't install guzzlehttp/guzzle v3.8.0|don't install guzzle/guzzle v3.9.3

    - Conclusion: remove guzzlehttp/guzzle v3.8.1|keep guzzle/guzzle v3.9.3
    - Installation request for aws/aws-sdk-php 2.* -> satisfiable by aws/aws-sdk-php[2.0.0,… 2.8.9].

そもそも、guzzleライブラリ自体、v3でPHP5.3の対応を終了しています。
https://github.com/guzzle/guzzle
ですので、PHP5.3で使うなら、guzzle3を使うように設定する必要があります。
https://github.com/guzzle/guzzle3
※Pakagist上では、v3はv3.8.1が最新バージョンのようです。
https://packagist.org/packages/guzzlehttp/guzzle#v3.8.1

PHP5.3を利用している方は、guzzleを使うならcomposerをv1.7.2で止めておいたほうが良いでしょう。

php composer.phar self-update 1.7.2

さすがに、PHP5.3ではサービスを維持に支障がでてくるようになりましたねぇ。
今月でPHP5.6もサポート終了になるし、早いところアップデートしないと。

lancers
テクノロジーで誰もが自分らしく働ける社会をつくる。日本最大級のクラウドソーシング「ランサーズ」を運営
https://www.lancers.jp/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした