PHP: How to pear install HTTP2 and HTTP_Request2

April 16th, 2015

Warning: This post is 9 years old. Some of this information may be out of date.

Whilst working on a project recently I've found the need to install the HTTP2 package from the pear repository. I couldn't find any useful notes on how to install HTTP2 via pear so here's my notes on how to pear install HTTP2.

Firstly, make sure Pear is installed. On an Ubuntu system you can use apt-get to install:

$ sudo apt-get install php-pear

Then update the channels:

$ sudo pear update-channels

Search for HTTP2:

$ sudo pear search HTTP2

Retrieving data...0%
Matched packages, channel
Package Stable/(Latest) Local
HTTP2   1.1.1 (stable)  1.1.1 Miscellaneous HTTP utilities

Finally install HTTP2:

$ pear install HTTP2

downloading HTTP2-1.1.1.tgz ...
Starting to download HTTP2-1.1.1.tgz (13,033 bytes)
.....done: 13,033 bytes
install ok: channel://

Additionally, I needed to install HTTP_Request2:

$ pear install HTTP_Request2

downloading HTTP_Request2-2.2.1.tgz ...
Starting to download HTTP_Request2-2.2.1.tgz (107,339 bytes)
.........................done: 107,339 bytes
downloading Net_URL2-2.1.1.tgz ...
Starting to download Net_URL2-2.1.1.tgz (19,848 bytes)
...done: 19,848 bytes
install ok: channel://
install ok: channel://