0

I am trying to install a library, it was said in instructions to do it like this

composer require mailgun/mailgun-php php-http/curl-client guzzlehttp/psr7

but then I get "Your requirements could not be resolved to an installable set of packages"

so I try to set them right and in the end come down to

composer require mailgun/mailgun-php php-http/curl-client guzzlehttp/psr7 php-http/client-common:^1.1 php-http/httplug:^1.0 php-http/curl-client:^2.0

and then I get stuck with this message

php-http/curl-client 2.0.0 requires php-http/httplug ^2.0 -> satisfiable by php-http/httplug[2.0.x-dev, v2.0.0] but these conflict with your requirements or minimum-stability

which seems contrary to request before. So I am not sure what I am doing wrong here and how should I resolve this?

Blissful
  • 198
  • 8
  • Possible duplicate of [How to solve two packages requirements conflicts when running composer install?](https://stackoverflow.com/questions/21052831/how-to-solve-two-packages-requirements-conflicts-when-running-composer-install) – Sindhara Mar 20 '19 at 16:53
  • Maybe it could be similar but I am not using any dev-master versions here. – Blissful Mar 20 '19 at 17:35

1 Answers1

0

It looks like composer require tries to install the latest versions of the packages. And in your case the latest versions can't satisfy all of the requirements. You could specify the version as >0 and Composer would take older versions into consideration too when it tries to find the set of the dependencies that match all of your requirements. You can use composer require mailgun/mailgun-php:">0" php-http/curl-client:">0" guzzlehttp/psr7:">0" or set your requires value in your composer.json file to use any version from the oldest version onward:

"require": {
    "mailgun/mailgun-php": ">0",
    "php-http/curl-client": ">0",
    "guzzlehttp/psr7": ">0"
}

and then run composer update.

D Malan
  • 10,272
  • 3
  • 25
  • 50
  • This works, thanx. I guess you checked for latest packages with composer show "mailgun/mailgun-php" --all etc and then set it like this. Would like that composer somehow know this out of the box, but ok, glad that this works at least :) – Blissful Mar 22 '19 at 22:03
  • 1
    Agreed, I would also have liked that composer does that out of the box! I see now that you can set the version requirement to ">0" and it would have the same effect. – D Malan Mar 23 '19 at 11:21