Как установить PHP cURL на Linux Debian?
Как установить PHP cURL на Linux Debian?
Я попробовал следующий код и получил ошибку ниже
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 не удалось просмотреть и разрешить имена узлов.
После добавления соответствующих корней проблема была решена.
Ответы
Ответ 1
Введите консоль как root:
apt-get update && apt-get install php5-curl
или с помощью sudo:
sudo apt-get update && sudo apt-get install php5-curl
Извините, что пропустил.
1, проверьте конфигурацию DNS и, если вы вообще можете выполнить ping на любом хосте,
ping google.com
ping zm.archive.ubuntu.com
Если это не сработает, проверьте /etc/resolv.conf
или /etc/network/resolv.conf
, если нет, измените ваш apt-источник на другой.
/etc/apt/sources.list
Зеркала: http://www.debian.org/mirror/list
Вы не должны использовать источники Ubuntu на Debian и наоборот.
Ответ 2
Я написал статью о том, как [вручную установить curl на debian linu] [1] x.
[1]: http://www.jasom.net/how-to-install-curl-command-manually-on-debian-linux. Это его ярлык:
И перезапустите Apache. Если у вас будет ошибка во время пункта 6, попробуйте запустить apt-get install build-essential.
Ответ 3
Какой бы подход вы ни выбрали, убедитесь, что в конце у вас есть обновленная версия curl и libcurl. Вы можете сделать curl --version
и посмотреть версии.
Вот что я сделал, чтобы получить последнюю версию curl, установленную в Ubuntu:
-
sudo add-apt-repository "deb http://mirrors.kernel.org/ubuntu wily main"
-
sudo apt-get update
-
sudo apt-get install curl