Установка pecl_http в xubuntu - PullRequest
       43

Установка pecl_http в xubuntu

9 голосов
/ 19 декабря 2009

Согласно заголовку, я просто пытаюсь установить расширение pecl_http для php в Ubuntu.

Итак, я сделал то, что имеет больше смысла:

andreas@earl ~ $ sudo pecl install pecl_http
downloading pecl_http-1.6.6.tgz ...
Starting to download pecl_http-1.6.6.tgz (173,645 bytes)
.....................................done: 173,645 bytes
71 source files, building
running: phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519
 1. whether to enable cURL HTTP requests; specify libcurl directory : yes

1-1, 'all', 'abort', or Enter to continue: 
 1. whether to enable support for gzencoded/deflated message bodies; specify zlib directory : yes

1-1, 'all', 'abort', or Enter to continue: 
 1. whether to enable response content type guessing; specify libmagic directory : no

1-1, 'all', 'abort', or Enter to continue: 
 1. whether to depend on extensions which have been built shared : yes

1-1, 'all', 'abort', or Enter to continue: 
building in /var/tmp/pear-build-root/pecl_http-1.6.6
running: /tmp/pear/temp/pecl_http/configure --with-http-curl-requests --with-http-zlib-compression --with-http-magic-mime=no --with-http-shared-deps

checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for gcc... gcc

.... <snip>

checking for unistd.h... (cached) yes
checking for gethostname... yes
checking for getdomainname... yes
checking for getservbyport... yes
checking for getservbyname... yes
checking for zlib.h... found in /usr
checking for zlib version >= 1.2.0.4... 1.2.3.3
checking for curl/curl.h... not found
configure: error: could not find curl/curl.h
ERROR: `/tmp/pear/temp/pecl_http/configure --with-http-curl-requests --with-http-zlib-compression --with-http-magic-mime=no --with-http-shared-deps' failed

Итак, у меня нет скручивания в системе, поэтому я делаю

andreas@earl ~ $ sudo apt-get install php5-curl

Curl установлен нормально, поэтому я попытался установить php5-http снова, но все равно та же ошибка.

Кто-нибудь может поделиться светом, пожалуйста? (

-aw

Ответы [ 4 ]

19 голосов
/ 19 декабря 2009

Сообщение, которое вы получаете, не указывает на отсутствие пакета PHP curl.

Вместо этого проблема заключается в том, что у вас, похоже, нет «системного» пакета curl - или, по крайней мере, не его «версии» разработки, которая содержит файлы, необходимые для компиляции pecl_http.

Судя по быстрому apt-cache search:

$ LANG=en apt-cache search libcurl dev
libcurl4-gnutls-dev - Development files and documentation for libcurl (GnuTLS)
libcurl4-openssl-dev - Development files and documentation for libcurl (OpenSSL)
...

Вы, вероятно, должны установить либо libcurl4-gnutls-dev, либо libcurl4-openssl-dev.
(В последний раз, когда я компилировал PHP, я установил первый из них, и это позволило мне скомпилировать PHP с включенной поддержкой curl)

10 голосов
/ 14 ноября 2011

или .. просто sudo apt-get install libcurl3-dev предоставит curl/curl.h, и ваша pecl_http установка будет продолжена

2 голосов
/ 05 сентября 2013

Поздно, но это решило мою проблему в Ubuntu 13.04:

sudo apt-get install -y curl libcurl3 libcurl4-gnutls-dev libmagic-dev, затем sudo pecl install pecl_http.

Кредиты: http://web.onassar.com/blog/2012/07/15/installing-pecl-http-package-on-ubuntu-11-10/

2 голосов
/ 14 мая 2013

Это работает на моем Ubuntu 12.10

sudo apt-get install libcurl3-openssl-dev
sudo pecl install -a pecl_http

sudo sh -c "echo 'extension=http.so' > /etc/php5/mods-available/http.ini"
sudo ln -s /etc/php5/mods-available/http.ini /etc/php5/conf.d/

Вам нужно будет перезагрузить веб-сервер, чтобы загрузить этот модуль.

sudo service apache2 restart
or
sudo service nginx restart
...