Wie installiere ich PHP cURL unter Linux Debian? Ich habe den folgenden Code ausprobiert und unten die Fehlermeldung erhalten
apt-get update
apt-get install curl libcurl3 php5-curl
Error:
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.
Ich habe dieses Problem gelöst. Meine Linux-Box konnte Hostnamen nicht durchsuchen und auflösen. Nach dem Hinzufügen der entsprechenden Stammstämme wurde das Problem behoben.
Geben Sie als root die Konsole ein:
apt-get update && apt-get install php5-curl
oder mit Sudo:
Sudo apt-get update && Sudo apt-get install php5-curl
Entschuldigung, ich habe missgelesen.
Erstens, überprüfen Sie Ihre DNS-Konfiguration und ob Sie überhaupt einen Host anpingen können.
ping google.com
ping zm.archive.ubuntu.com
Wenn dies nicht funktioniert, überprüfen Sie /etc/resolv.conf
oder /etc/network/resolv.conf
. Falls nicht, ändern Sie Ihre apt-source in eine andere.
/etc/apt/sources.list
Mirrors: http://www.debian.org/mirror/list
Sie sollten keine Ubuntu-Quellen unter Debian verwenden und umgekehrt.
Ich habe einen Artikel über topis geschrieben, wie man curl auf debian linu manuell installiert [x].
[1]: http://www.jasom.net/how-to-install-curl-command-manually-on-debian-linux . Dies ist die Abkürzung:
Und starte Apache neu. Wenn unter Punkt 6 ein Fehler auftritt, führen Sie apt-get install build-essential aus.
Was auch immer Sie tun, stellen Sie am Ende sicher, dass Sie eine aktualisierte Version von curl und libcurl haben. Sie können curl --version
tun und die Versionen sehen.
So habe ich die neueste Curl-Version in Ubuntu installiert:
Sudo add-apt-repository "deb http://mirrors.kernel.org/ubuntu wily main"
Sudo apt-get update
Sudo apt-get install curl