如何在Linux Debian上安装PHP cURL?

Inv*_*tor 17 php linux curl

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

apt-get update
apt-get install curl libcurl3 php5-curl
Run Code Online (Sandbox Code Playgroud)

错误:

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.
Run Code Online (Sandbox Code Playgroud)

我解决了这个问题.我的Linux框无法浏览和解析主机名.添加适当的根后,问题得到解决.

Dan*_* W. 44

以root身份键入控制台:

apt-get update && apt-get install php5-curl
Run Code Online (Sandbox Code Playgroud)

或者与sudo:

sudo apt-get update && sudo apt-get install php5-curl
Run Code Online (Sandbox Code Playgroud)

对不起我想念.

1,检查你的DNS配置,如果你可以ping任何主机,

ping google.com
ping zm.archive.ubuntu.com
Run Code Online (Sandbox Code Playgroud)

如果它不工作,检查/etc/resolv.conf或者/etc/network/resolv.conf,如果没有,改变APT源到不同的一个.

/etc/apt/sources.list
Run Code Online (Sandbox Code Playgroud)

镜子:http://www.debian.org/mirror/list

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