如何在PHP5.x上安装http_pecl?

如何在PHP5.x上安装http_pecl?,php,pecl,Php,Pecl,我试图在Ubuntu14.04上安装pecl\uHTTP,但据报道需要PHP7 $ sudo pecl install pecl_http pecl/pecl_http requires PHP (version >= 7.0.0), installed version is 5.5.9-1ubuntu4.14 pecl/raphf requires PHP (version >= 7.0.0), installed version is 5.5.9-1ubuntu4.14 pecl

我试图在Ubuntu14.04上安装
pecl\uHTTP
,但据报道需要PHP7

$ sudo pecl install pecl_http
pecl/pecl_http requires PHP (version >= 7.0.0), installed version is 5.5.9-1ubuntu4.14
pecl/raphf requires PHP (version >= 7.0.0), installed version is 5.5.9-1ubuntu4.14
pecl/propro requires PHP (version >= 7.0.0), installed version is 5.5.9-1ubuntu4.14
No valid packages found
install failed
$
与Debian类似:

pecl/pecl_http requires PHP (version >= 7.0.0), installed version is 5.6.17-0+deb8u1
pecl/raphf requires PHP (version >= 7.0.0), installed version is 5.6.17-0+deb8u1
pecl/propro requires PHP (version >= 7.0.0), installed version is 5.6.17-0+deb8u1
我找不到任何
pecl_http
与PHP5.x不向后兼容的信息


我尝试使用PHP7.0并成功安装了它,但是我能做些什么来使用PHP5.x安装它吗?

您需要找出哪个版本的
pecl\u http
不需要当前版本的PHP,然后专门安装该版本。根据文件:

“包[-version/state][.tar]”:查询默认频道的服务器 (pear.php.net)下载最新的软件包 首选质量/状态(稳定)

要检索包版本1.1,请使用“Package-1.1”检索 包状态beta,使用“包beta.”检索未压缩的 文件append.tar(首先确保没有同名文件)

而且,
pecl_http
3.0是第一个与PHP7兼容的版本,所以可以试试前面的版本


最终答案:您将寻找
sudo pecl install pecl_http-2.5.5

这个问题有一个公认的答案,但我将在主题上加上我的2美分:

根据您的PHP版本:

  • 对于PHP7,请使用“pecl安装oci8”
  • 对于PHP5.2到5.6,请使用“pecl安装oci8-2.0.12”
  • 对于PHP4.3.9到5.1,请使用“pecl安装oci8-1.4.10”
OCI8是PHP5.6.x的最终版本

OCI82.1.x仅适用于PHP7

安装适用于PHP 5.6.31的OCI8

[root@server bin]# ./pecl install oci8-2.0.12
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading oci8-2.0.12.tar ...
Starting to download oci8-2.0.12.tar (1,615,360 bytes)
....
11 source files, building
running: phpize
Configuring for:
...
预期产量

这是安装OCI8支持的最简单方法