如何在Ubuntu上安装PECL_HTTP

4

我试图安装pecl_http,我已经安装了:

sudo apt-get install php-pear sudo apt-get install php5-dev sudo apt-get install libcurl3-openssl-dev sudo apt-get install libcurl4-openssl-dev

但是当我尝试运行以下命令时:

sudo apt-get install pecl_http

我得到了以下错误信息:

downloading pecl_http-2.2.0.tgz ...
Starting to download pecl_http-2.2.0.tgz (172,406 bytes)
.....................................done: 172,406 bytes
65 source files, building
running: phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
where to find zlib [/usr] : 
where to find libcurl [/usr] : 
where to find libevent [/usr] : 
building in /tmp/pear/temp/pear-build-root2eJFqQ/pecl_http-2.2.0
running: /tmp/pear/temp/pecl_http/configure --with-http-zlib-dir=/usr --with-http-libcurl-dir=/usr --with-http-libevent-dir=/usr
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 cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
checking for PHP extension directory... /usr/lib/php5/20090626+lfs
checking for PHP installed headers prefix... /usr/include/php5
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking whether to enable extended HTTP support... yes, shared
checking for egrep... (cached) /bin/grep -E
checking for a sed that does not truncate output... (cached) /bin/sed
checking how to run the C preprocessor... cc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for off_t... yes
checking for mbstate_t... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking for unistd.h... (cached) yes
checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking wctype.h usability... yes
checking wctype.h presence... yes
checking for wctype.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking for gethostname... yes
checking for getdomainname... yes
checking for mbrtowc... yes
checking for mbtowc... yes
checking for iswalnum... yes
checking for inet_pton... yes
checking for idna.h... found in /usr
checking for zlib.h... found in /usr
checking for zlib version >= 1.2.0.4... 1.2.3.4
checking for curl/curl.h... found in /usr
checking for curl-config... found: /usr/bin/curl-config
checking for curl version >= 7.18.2... 7.22.0
checking for SSL support in libcurl... yes
checking for openssl support in libcurl... no
checking for gnutls support in libcurl... no
checking for ares support in libcurl... no
checking for bundled SSL CA info... /etc/ssl/certs/ca-certificates.crt
checking for event2/event.h... not found
configure: WARNING: continuing without libevent support
checking for ext/raphf support... no
configure: error: Please install pecl/raphf and activate extension=raphf.so in your php.ini
ERROR: `/tmp/pear/temp/pecl_http/configure --with-http-zlib-dir=/usr --with-http-libcurl-dir=/usr --with-http-libevent-dir=/usr' failed

有人可以帮助我吗?我需要尽快解决这个问题。

1个回答

3

安装缺少的包pecl/raphf,然后将其添加到您的php.ini文件中即可。

$ sudo pecl install raphf

并且在配置文件中添加 extension=raphf.so

$ sudo nano /etc/php5/conf.d/raphf.ini

现在尝试重新安装pecl_http。
$ sudo pecl install pecl_http

parsePackageName(): 在 "raphf.so" 中存在无效的包名。 无效的包名/包文件 "raphf.so"。 安装失败。 - Sherly Febrianti
我在 /usr/lib/php5/20090626+lfs 目录下有 raphf.so 和 propro.so,并且已经在 <b>php.ini</b> 中进行了配置:<br/> extension = raphf.so <br/> extension = propro.so - Sherly Febrianti
尝试不带 .so 部分 - karlingen
pecl/raphf 已经安装并且与发布的版本 1.0.4 相同,安装失败。尝试安装 sudo pecl install pecl_http 时,虽然已经安装了,但是出现了上述信息:请在您的 php.ini 中安装 pecl/raphf 并激活 extension=raphf.so - Sherly Febrianti
2
extension=raphf.so 添加到您的 php.ini 文件中。但是,您必须将其添加到正确的 php.ini 文件中。/etc/php5/cli/php.ini 是 cli 的默认安装路径,如果您使用 apache2,则为 /etc/php5/apache2/php.ini - karlingen
好的,谢谢!它可以工作 :) - Sherly Febrianti

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接