How to install http_pecl on PHP 5.x?
Asked Answered
I

2

9

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?

Intonation answered 22/2, 2016 at 22:54 Comment(0)
M
18

You'll need to find out what version of pecl_http doesn't require the current version of PHP, and then specifically install that one. According to the documentation:

"Package[-version/state][.tar]" : queries your default channel's server (pear.php.net) and downloads the newest package with the preferred quality/state (stable).

To retrieve Package version 1.1, use "Package-1.1," to retrieve Package state beta, use "Package-beta." To retrieve an uncompressed file, append .tar (make sure there is no file by the same name first)

And according to the changelog, pecl_http 3.0 is the first PHP 7 compatible version, so maybe try the previous.

Final answer: you'd be looking for sudo pecl install pecl_http-2.5.5

Mohican answered 22/2, 2016 at 23:9 Comment(0)
P
4

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.

Pilcher answered 11/7, 2017 at 22:22 Comment(1)
Did OP need pecl_http and not oci8 or am I not getting something right?Nunnally

© 2022 - 2024 — McMap. All rights reserved.