douxianglu4370
douxianglu4370
2016-04-15 08:26

安装php5-geoip失败

已采纳

When I try to install php5-geoip on my debian, I get an error :

root@pandora:~# LANG=C apt-get install php5-geoip
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php5-geoip : Depends: phpapi-20100525
E: Unable to correct problems, you have held broken packages.
root@pandora:~#

When I try to install the dependency, here is the output :

root@pandora:~# LANG=C apt-get install phpapi-20100525
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package phpapi-20100525 is a virtual package provided by:
  php5-fpm 5.4.45-0+deb7u2 [Not candidate version]
  php5-cli 5.4.45-0+deb7u2 [Not candidate version]
  php5-cgi 5.4.45-0+deb7u2 [Not candidate version]
  libphp5-embed 5.4.45-0+deb7u2 [Not candidate version]
  libapache2-mod-php5filter 5.4.45-0+deb7u2 [Not candidate version]
  libapache2-mod-php5 5.4.45-0+deb7u2 [Not candidate version]

E: Package 'phpapi-20100525' has no installation candidate
root@pandora:~#

apt-get update and apt-get upgrade both works with nothing to update or install. I can install any other package.

Thanks if anyone accepts to help me :-)

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • dongxiaoyan4388 dongxiaoyan4388 5年前

    From the errors you're getting, you don't have a package available that matches your current PHP package. You have two choices. First, you can use the new PHP version (no compiled code necessary.) If you have composer already installed for your project, you can do this easily:

    php composer.phar require geoip2/geoip2:~2.0
    

    Or, second choice, install the original package from PECL. Assuming you have already installed the appropriate PEAR package, and have development tools available (e.g. make and gcc) you can try these steps:

    apt-get install libgeoip-dev
    pecl install geoip
    

    See here or here for more details.

    点赞 评论 复制链接分享

相关推荐