Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install http_pecl on PHP 5.x?

Tags:

php

pecl

I am trying to install pecl_http on Ubuntu 14.04, however it reports to require PHP 7.

$ 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
$

Similarly on 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

I can't find changelog any information that pecl_http is not backward compatible with PHP 5.x.

I tried with PHP 7.0 and it installed successfully, but is there anything I can do to install it with PHP 5.x?

like image 614
techraf Avatar asked Feb 22 '16 22:02

techraf


1 Answers

This question has an accepted answer, but I will add my 2 cents to the subject:

Based on your PHP version:

  • for PHP 7 use 'pecl install oci8'
  • for PHP 5.2 to 5.6 use 'pecl install oci8-2.0.12'
  • for PHP 4.3.9 to 5.1 use 'pecl install oci8-1.4.10'

OCI8 2.0.12 is the final release for PHP 5.6.x

OCI8 2.1.x is only valid for PHP 7

Installing OCI8 for PHP 5.6.31:

[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:
...

Expected output for PHP 5.6.31 and OCI8 2.0.12

This is the easiest way to install OCI8 support.

like image 81
Daniel Vukasovich Avatar answered Oct 24 '22 00:10

Daniel Vukasovich