guzzle / guzzle

Guzzle, an extensible PHP HTTP client

Home Page:https://docs.guzzlephp.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHP version (8.1.8) does not satisfy that requirement - Installing Guzzle ^7.0.

christoferd opened this issue · comments

Guzzle version(s) affected: ^7.0 (via composer)
PHP version: 8.1.8
cURL version: 7.77.0

Description
Error while installing via Composer.
Says that the PHP version is not satisfyable, but in GitHub readme for Guzzle v7.0 it states PHP >=7.2.5,<8.3
Using cli command seen in documentation: composer require guzzlehttp/guzzle:^7.0
Then tried adding "-W" as recommended by Composer
Command: composer require guzzlehttp/guzzle:^7.0 -W

Error:
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Root composer.json requires guzzlehttp/guzzle 7.0 -> satisfiable by guzzlehttp/guzzle[7.0.0].
- guzzlehttp/guzzle 7.0.0 requires php ^7.2.5 -> your php version (8.1.8) does not satisfy that requirement.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

How to reproduce
With PHP 8.1.8
Command: composer require guzzlehttp/guzzle:^7.0 -W

Possible Solution
Fix the composer dependencies?

Additional context
none

I figured this out...

I didn't pay enough attention to this line:
The "7.0" constraint for "guzzlehttp/guzzle" appears too strict and will likely not match what you want.

This command worked fine: composer require guzzlehttp/guzzle:7.5.0 -W

The problem if you will have used 7.0 instead of ^7.0.

Using 7.5.0 as the version constraint is also a bad security practice. You will not get the latest version when it is released. You should use ^7.0 or ^7.5.