我试图安装这个扩展,但在configuration阶段失败。 我在Ubuntu的12.04,我刚刚安装了这些软件包:
PHP版本:
PHP 5.3.10-1ubuntu3.14 with Suhosin-Patch (cli) (built: Sep 4 2014 07:08:49) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans
以下是安装命令的日志:
sudo pecl install pecl_http downloading pecl_http-2.1.1.tgz ... Starting to download pecl_http-2.1.1.tgz (158,441 bytes) .................................done: 158,441 bytes 64 source files, building running: phpize Configuring for: PHP Api Version: 20090626 Zend Module Api No: 20090626 Zend Extension Api No: 220090626 Enable extended HTTP support [yes] : where to find zlib [/usr] : where to find libcurl [/usr] : where to find libevent [/usr] : building in /tmp/pear/temp/pear-build-rootqE2kgU/pecl_http-2.1.1 running: /tmp/pear/temp/pecl_http/configure --with-http --with-http-zlib-dir=/usr --with-http-libcurl-dir=/usr --with-http-libevent-dir=/home/gare88/Lib/Php/libevent-2.0.21-stable/ checking for grep that handles long lines and -e... /bin/grep [... cut...] 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 --with-http-zlib-dir=/usr --with-http-libcurl-dir=/usr --with-http-libevent-dir=/usr' failed
看来这是一个pecl / raphf的问题,所以我试过了:
sudo pecl install raphf pecl/raphf is already installed and is the same as the released version 1.0.4 install failed
在位于/etc/php5/apache2/php.ini的php.ini文件的末尾添加了一行:
extension=raphf.so extension=propro.so extension=http.so
还有什么我可以尝试?
你需要从你的包管理器安装php-raphf。
对我来说,我安装了使用以下模块。 在你的情况下,你应该能够切换出适合apt-get的yum。
sudo yum install php-raphf sudo yum install php-propro sudo pecl install pecl_http
您需要将extension = http.so添加到您的php.ini文件中。 但看起来你已经做到了。
pecl实际上并不安装您正在查找的.so文件。
如果你有Ubuntu 13或14,请尝试pecl install pecl_http-1.7.6
,由于某些原因,新版本仍然无法加载。
只是添加到@ mschuett的答案,我发现,当我得到同样的错误为OP,改变我的扩展名引用在php.ini做的窍门。
extension=raphf.so
至
extension=/usr/lib/php5/20121212/raphf.so
然后
sudo pecl install pecl_http
同时设置以下内容将使您不必手动编辑您的php.ini文件,当pecl安装想要修改它时:
pear config-set php_ini /etc/php5/apache2/php.ini pecl config-set php_ini /etc/php5/apache2/php.ini
注意:这适用于Ubuntu 14.04 LTS。
在Ubuntu 12.04.5 LTS这工作对我来说:
首先安装编译所需的一些先决条件:
sudo apt-get install php-http sudo apt-get install php5-dev sudo apt-get install libcurl3 sudo apt-get install libpcre3-dev sudo apt-get install libcurl4-openssl-dev sudo pecl install raphf sudo pecl install pecl_http-1.7.6
之后,去到/usr/lib/php5/modules
文件夹,并检查库是否存在: raphf.so
, propro.so
和http.so
如果您的php.ini
(位于/etc/php5/apache2/php.ini
和/etc/php5/cli/php.ini
)不包含这些扩展名,请添加它们:
extension=http.so extension=propro.so extension=raphf.so
或者使用文件的绝对路径,例如extension=/usr/lib/php5/modules/http.so
而最后一步重新启动您的网络服务器,从而加载新的配置:
sudo service apache2 reload
运行命令
sudo yum安装php-raphf
sudo pecl安装pecl_http
等/ phph5 / apache2的/ conf.d
添加两个文件
添加内容
延长= raphf.so
solr.ini
添加内容
延长= raphf.so
添加在php.ini文件中
extension = http.so extension = propro.so extension = raphf.so或extension = / usr / lib / php5 / 20121212 / raphf.so extension = solr.so