安装GeoIP2时出错:geoip2 / geoip2 v2.3.1需要maxmind / web-service-common

时间:2016-05-19 07:38:58

标签: php composer-php geoip

尝试安装GeoIP2时遇到此错误。不幸的是,错误消息不是很容易上传,我无法弄清楚如何解决它。显然缺少某些东西,但我不确定是什么。我对作曲家不是很有经验。任何人都可以帮我解读这个错误吗?

$ 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.

2 个答案:

答案 0 :(得分:1)

万一有人偶然发现了同样的问题......

解决方法是在getActivity()文件中启用curl扩展名,因为错误消息的最后一部分表明:

php.ini

我刚刚从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. 删除了分号,但它确实有效。

我还需要最新版本的GeoID(不是github文档建议的2.0):

;extension=php_curl.dll

答案 1 :(得分:1)

是的,只需安装cURL,它就会成功安装 对于使用php5的Ubuntu: sudo apt-get install php5-curl

对于带有php7的Ubuntu:sudo apt-get install php7.0-curl