如何在Linux Debian上安装PHP cURL?

如何在Linux Debian上安装PHP cURL?,php,linux,curl,Php,Linux,Curl,如何在Linux Debian上安装PHP cURL? 我尝试了下面的代码,得到了下面的错误 apt-get update apt-get install curl libcurl3 php5-curl 错误: W: Failed to fetch http://zm.archive.ubuntu.com/ubuntu/dists/precise-updates/universe/binary-i386/Packages Something wicked happened resolving

如何在Linux Debian上安装PHP cURL? 我尝试了下面的代码,得到了下面的错误

apt-get update
apt-get install curl libcurl3 php5-curl
错误:

W: Failed to fetch http://zm.archive.ubuntu.com/ubuntu/dists/precise-updates/universe/binary-i386/Packages  Something wicked happened resolving 'zm.archive.ubuntu.com:http' (-5 - No address associated with hostname)

W: Failed to fetch http://zm.archive.ubuntu.com/ubuntu/dists/precise-updates/multiverse/binary-i386/Packages  Something wicked happened resolving 'zm.archive.ubuntu.com:http' (-5 - No address associated with hostname)

W: Failed to fetch http://zm.archive.ubuntu.com/ubuntu/dists/precise-updates/main/i18n/Translation-en_US  Something wicked happened resolving 'zm.archive.ubuntu.com:http' (-5 - No address associated with hostname)

W: Failed to fetch http://zm.archive.ubuntu.com/ubuntu/dists/precise-updates/main/i18n/Translation-en  Something wicked happened resolving 'zm.archive.ubuntu.com:http' (-5 - No address associated with hostname)

W: Failed to fetch http://zm.archive.ubuntu.com/ubuntu/dists/precise-updates/multiverse/i18n/Translation-en_US  Something wicked happened resolving 'zm.archive.ubuntu.com:http' (-5 - No address associated with hostname)

W: Failed to fetch http://zm.archive.ubuntu.com/ubuntu/dists/precise-updates/multiverse/i18n/Translation-en  Something wicked happened resolving 'zm.archive.ubuntu.com:http' (-5 - No address associated with hostname)

W: Failed to fetch http://zm.archive.ubuntu.com/ubuntu/dists/precise-updates/restricted/i18n/Translation-en_US  Something wicked happened resolving 'zm.archive.ubuntu.com:http' (-5 - No address associated with hostname)

W: Failed to fetch http://zm.archive.ubuntu.com/ubuntu/dists/precise-updates/restricted/i18n/Translation-en  Something wicked happened resolving 'zm.archive.ubuntu.com:http' (-5 - No address associated with hostname)

W: Failed to fetch http://zm.archive.ubuntu.com/ubuntu/dists/precise-updates/universe/i18n/Translation-en_US  Something wicked happened resolving 'zm.archive.ubuntu.com:http' (-5 - No address associated with hostname)

W: Failed to fetch http://zm.archive.ubuntu.com/ubuntu/dists/precise-updates/universe/i18n/Translation-en  Something wicked happened resolving 'zm.archive.ubuntu.com:http' (-5 - No address associated with hostname)

E: Some index files failed to download. They have been ignored, or old ones used instead.
我解决了这个问题。我的Linux设备无法浏览和解析主机名。
添加适当的根目录后,问题得到解决。

在控制台中键入根目录:

apt-get update && apt-get install php5-curl
或者用sudo:

sudo apt-get update && sudo apt-get install php5-curl
对不起,我读错了

首先,检查您的DNS配置,如果您可以ping任何主机

ping google.com
ping zm.archive.ubuntu.com
如果不工作,请检查
/etc/resolv.conf
/etc/network/resolv.conf
,如果不工作,请将apt源更改为其他源

/etc/apt/sources.list
镜像:


你不应该在Debian上使用Ubuntu源代码,反之亦然。

我写了一篇关于topis如何[在Debian linu上手动安装curl][1]x的文章

[1] :。这是它的捷径:

  • cd/usr/local/src
  • wget
  • tar-xvzf curl-7.36.0.tar.gz
  • rm*.gz
  • cd-7.6.0
  • /配置
  • 制造
  • 安装

  • 然后重新启动Apache。如果在第6点出现错误,请尝试运行apt-get-install-build-essential

    无论您采取何种方法,最后确保您有一个curl和libcurl的更新版本。您可以执行
    curl--version
    并查看版本

    下面是我为在Ubuntu中安装最新的curl版本所做的工作:

  • sudo添加apt存储库“debhttp://mirrors.kernel.org/ubuntu wily main“
  • sudo-apt-get-update
  • sudo apt get install curl

  • 我可以ping ubuntu站点的ip地址,但我的Web服务器似乎无法解析主机名请向服务器提供商询问
    /etc/resolv.conf
    中使用的dns设置,如果您在私人局域网中使用它,DNS服务器可能与路由器相同,您可以将以下内容放入此文件:
    nameserver 192.168.1.1
    感谢您提供的简洁信息。更新步骤2,最新版本是:我最终发现这种方法存在问题,因为它没有将libcurl更新为最新版本。我将输入另一个答案,其中包含我最终做了什么的信息。。。