3
3

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.

PHPAdvent Calendar 2018

Day 7

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

Last updated at Posted at 2018-12-06

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もサポート終了になるし、早いところアップデートしないと。

3
3
2

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
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?