在xubuntu中安装pecl_http

And*_*ong 9 php http pecl

根据标题,我只是想在ubuntu中为php安装pecl_http扩展.

所以我做了最有意义的事情:

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

好吧,我没有卷曲系统,所以我这样做

andreas@earl ~ $ sudo apt-get install php5-curl
Run Code Online (Sandbox Code Playgroud)

curl安装正常,所以我再次尝试安装php5-http,但仍然是同样的错误.

有人可以共享灯吗?:(

-aw

Pas*_*TIN 19

您收到的消息并不表示缺少PHP 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)
...
Run Code Online (Sandbox Code Playgroud)

您可能必须安装libcurl4-gnutls-devlibcurl4-openssl-dev.
(我最后一次编译PHP,我安装了第一次,它允许我编译PHP并启用curl支持)


bub*_*ier 10

或..只是sudo apt-get install libcurl3-dev提供curl/curl.h,您的pecl_http安装将继续