2

I am running into this error while trying to install GeoIP2. Unfortunately, the error message is not very googlable and I can't figure out how to fix it. It is clear that something is missing, but I am not sure what. I am not very experienced with composer. Can anyone help me decipher this error please?

$ composer require "geoip2/geoip2":"~2.0"
./composer.json has been updated
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
    - geoip2/geoip2 v2.3.1 requires maxmind/web-service-common ~0.0.3 -> satisfiable by maxmind/web-service-common[v0.0.3, v0.0.4].
    - geoip2/geoip2 v2.3.2 requires maxmind/web-service-common ~0.0.3 -> satisfiable by maxmind/web-service-common[v0.0.3, v0.0.4].
    - geoip2/geoip2 v2.3.3 requires maxmind/web-service-common ~0.0.3 -> satisfiable by maxmind/web-service-common[v0.0.3, v0.0.4].
    - geoip2/geoip2 v2.4.0 requires maxmind/web-service-common ~0.0.3 -> satisfiable by maxmind/web-service-common[v0.0.3, v0.0.4].
    - geoip2/geoip2 v2.3.0 requires maxmind/web-service-common ~0.0.2 -> satisfiable by maxmind/web-service-common[v0.0.2, v0.0.3, v0.0.4].
    - geoip2/geoip2 v2.0.0 requires guzzle/guzzle 3.* -> satisfiable by guzzle/guzzle[v3.0.0, v3.0.1, v3.0.2, v3.0.3, v3.0.4, v3.0.5, v3.0.6, v3.0.7, v3.1.0, v3.1.1, v3.1.2, v3.2.0, v3.3.0, v3.3.1, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.5.0, v3.6.0, v3.7.0, v3.7.1, v3.7.2, v3.7.3, v3.7.4, v3.8.0, v3.8.1, v3.9.0, v3.9.1, v3.9.2, v3.9.3].
    - geoip2/geoip2 v2.1.0 requires guzzle/guzzle 3.* -> satisfiable by guzzle/guzzle[v3.0.0, v3.0.1, v3.0.2, v3.0.3, v3.0.4, v3.0.5, v3.0.6, v3.0.7, v3.1.0, v3.1.1, v3.1.2, v3.2.0, v3.3.0, v3.3.1, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.5.0, v3.6.0, v3.7.0, v3.7.1, v3.7.2, v3.7.3, v3.7.4, v3.8.0, v3.8.1, v3.9.0, v3.9.1, v3.9.2, v3.9.3].
    - geoip2/geoip2 v2.1.1 requires guzzle/guzzle 3.* -> satisfiable by guzzle/guzzle[v3.0.0, v3.0.1, v3.0.2, v3.0.3, v3.0.4, v3.0.5, v3.0.6, v3.0.7, v3.1.0, v3.1.1, v3.1.2, v3.2.0, v3.3.0, v3.3.1, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.5.0, v3.6.0, v3.7.0, v3.7.1, v3.7.2, v3.7.3, v3.7.4, v3.8.0, v3.8.1, v3.9.0, v3.9.1, v3.9.2, v3.9.3].
    - maxmind/web-service-common v0.0.4 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - maxmind/web-service-common v0.0.3 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - maxmind/web-service-common v0.0.2 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.9.3 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.9.2 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.9.1 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.9.0 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.8.1 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.8.0 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.7.4 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.7.3 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.7.2 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.7.1 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.7.0 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.6.0 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.5.0 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.4.3 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.4.2 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.4.1 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.4.0 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.3.1 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.3.0 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.2.0 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.1.2 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.1.1 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.1.0 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.0.7 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.0.6 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.0.5 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.0.4 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.0.3 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.0.2 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.0.1 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - guzzle/guzzle v3.0.0 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - Installation request for geoip2/geoip2 ~2.0 -> satisfiable by geoip2/geoip2[v2.0.0, v2.1.0, v2.1.1, v2.3.0, v2.3.1, v2.3.2, v2.3.3, v2.4.0].

  To enable extensions, verify that they are enabled in those .ini files:
    - C:\PHP\php.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

Installation failed, reverting ./composer.json to its original content.
Arthur Tarasov
  • 3,517
  • 9
  • 45
  • 57
  • run 'composer update' before installing geoip and then, add to composer.json the require and run update again –  May 19 '16 at 07:50
  • @stig-js Thank you for suggestion. I did all that but I get the same exact error while running update for the second time – Arthur Tarasov May 19 '16 at 08:09

2 Answers2

5

Yes, Just install cURL, it will successfully install For Ubuntu with php5: sudo apt-get install php5-curl

For Ubuntu with php7: sudo apt-get install php7.0-curl

For Ubuntu with php7.4: sudo apt-get install php7.4-curl

niilante
  • 468
  • 7
  • 15
Allahbakash.G
  • 1,805
  • 1
  • 15
  • 17
0

Just in case someone stumbles upon the same issue...

The solution is to enable curl extension in php.ini file as the last part of the error message suggests:

To enable extensions, verify that they are enabled in those .ini files:
    - C:\PHP\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

I just removed semicolon from ;extension=php_curl.dll and it worked.

I also required the latest version of GeoID (not 2.0 as the github docs suggest):

composer require geoip2/geoip2:~2.4.0
Arthur Tarasov
  • 3,517
  • 9
  • 45
  • 57