Installation/Konfiguration

Installation

Diese » PECL-Extension ist nicht Teil von PHP.

Information zur Installation dieser PECL-Extension finden sie im Kapitel Installation von PECL-Extensions. Zusätzliche Informationen wie neue Releases, Downloads, Quelldateien, Maintainerinformation und ein CHANGELOG finden Sie hier: » http://pecl.php.net/package/pecl_http.

Hinweis: Der offizielle Name dieser Erweiterung lautet pecl_http.

Eine DLL-Datei für diese PECL-Erweiterung steht derzeit nicht zur Verfügung. Weitere Details finden Sie im Abschnitt zum Kompilieren für Windows.

add a note add a note

User Contributed Notes 21 notes

up
12
csaltos at gmail dot com
11 months ago
The pecl_http version 1 is no longer the default major version, so many of the functions and references in this documentation will not work with newer versions.

Try to install the correct pecl_http package for the version 1 you want to use, or refer to a newer version described in the pecl package you want to install.

In my case, I want the version 1, so I issued the command:

pecl install http://pecl.php.net/get/pecl_http-1.7.6.tgz

Ensure you have the latest minor versions for the pecl_http package specified at http://pecl.php.net/package/pecl_http

The documentation for pecl_http version 2 is at http://devel-m6w6.rhcloud.com/mdref/http but I warn you, the version 2 is too different, actually simple functions like http_redirect do not exist in version 2. (I'm wondering, why they did not use a different project name if the version 2 is so different !!)
up
17
d4p3r
11 months ago
Look out! Since version 2.0, the extension has been completely renovated. Now you need to pre-load the extensions "raphf", "propro" and "spl". This work for me in Ubuntu 12.04:

apt-get install php-http
pecl install pecl_http

- In php.ini files:
     extension=raphf.so
     extension=propro.so
     extension=http.so

The spl extension is compiled by default in PHP 5.0.0 and since version 5.3.0 can not be disabled.

In addition, instantiation should be done using namespaces nomenclature, such as: new http \ Client ().

Beware! This version is incompatible with version 1 and the  event extension.

More information: http://devel-m6w6.rhcloud.com/mdref/http/
up
3
Anonymous
7 months ago
!!! WARNING !!!

Version 2 of this library is COMPLETELY INCOMPATIBLE with Version 1!

None of the HTTP functions exist in Version 2!

This is NOT stated ANYWHERE in the docs on PHP.net.

From the looks of it Version 2 is a completely OOP interface and drops support for all the functions listed here in the docs.

If you are looking for the functional API use Version 1!
up
3
Mohd Azhar bin Ariffin
6 years ago
The installation guideline is very insufficient. I've installed for Debian lenny/sid with the following step;

apt-get install php5-dev (to enable pecl command)
apt-get install libcurl3 (to get curl support)
apt-get install libmagic

and

pecl install pecl_http

pecl will download and compile but before that just follow the prompt. If the respective development library is not available in your system, the compilation will abort.

After pecl_http got install, copy /usr/lib/php5/20060613+lfs/http.so to /usr/lib/apache2/modules and restart apache

Hopefully this will help others from facing the same hassle for quite sometime.
up
4
cheese dot cube at gmail dot com
1 year ago
To install this PECL extension on Ubuntu 12.10 run the following:

sudo apt-get install php-http make
sudo pecl install pecl_http

Then add the line "extension=http.so" to php.ini (Normally located at /etc/php5/apache2/php.ini) and restart Apache (sudo service apache2 restart).
up
2
Anon
1 year ago
up
2
bruno dot braga at gmail dot com
2 years ago
In Ubuntu 12.04:

# (curl-devel equivalent in Ubuntu is libcurl4-gnutls-dev)
sudo apt-get install libcurl3 php5-dev libcurl4-gnutls-dev libmagic-dev
sudo pecl install pecl_http
up
1
Jean-Lou Dupont
6 years ago
Don't forget to copy ''http.so'' in the php/modules directory and add ''extension=http.so'' to php.ini.
up
2
Anonymous
6 months ago
On debian 7 I had to do the following:

root@mp1:~# apt-get install php-http
root@mp1:~# apt-get install php5-dev
root@mp1:~# apt-get install libcurl3
root@mp1:~# apt-get install libpcre3-dev
root@mp1:~# apt-get install libcurl4-openssl-dev
root@mp1:~# pecl install pecl_http-1.7.6

add extension=http.so into /etc/php5/apache2/php.ini

root@mp1:~# /etc/init.d/apache2 restart
up
2
phpsharma at gmail dot com
1 year ago
A DLL for this PECL extension is currently unavailable. See also the building on Windows section.
up
0
dingxiaosong1987 at gmail dot com
6 months ago
centos 6.3 64

compile error

yum install libcurl-devel.x86_64

then ok
up
0
anon at anon dot com
2 years ago
For others who can't find pecl_http for PHP 5.3 on Windows...

You can download php_http.dll for PHP 5.3 from the official PHP for Windows site (windows.php.net) at http://downloads.php.net/pierre/
up
-1
aeternuslibertas at gmail dot com
2 years ago
If you are on Arch linux you can install this via pear.
just install pear first with pacman, then once php-pear is installed you can # pecl install pecl_http
up
0
srimalj at gmail dot com
6 years ago
Just to add to the above.

I had to install the following in Ubuntu 7.10 .

(otherwise I get a message saying missing curl.h)

# apt-get install libcurl4-gnutls-dev

Hope this helps someone the trouble i went into, just to get the http_post_fields function working

Regs

Srimal.
up
0
Christian9997
7 years ago
The "Installation requirements on Windows" are confusing:

If you are a Windows user you need to have the php_curl.dll extension installed before being able to install the php_http.dll extension.
up
-1
JeroenVD
1 year ago
On my Centos 6.4:

chmod +x /usr/lib64/php/modules/http.so
up
-1
Anonymous
9 months ago
Hi guys

I am configuring this on Ubuntu system and when I tried to run

pecl install pecl_http

it used to fail because it did not find pcre.h
I found out that I need to apt-get install

libcurl4-openssl-dev
libevent-dev
libpcre3-dev                       - here is where the pcre.h is available

then I run it again and when it asks me for the zlib, libcurl and libevent I specify the respective folders where the src of each of them is located.

So in that way it worked, and the pecl managed to corectly compile a brand new 'http.so' just under '/usr/lib/php5/20090626+lfs/http.so'

Then under both of

    /etc/php5/apache2/php.ini
    and
    /etc/php5/cli/php.ini

I inserted this: 
     extension=/usr/lib/php5/20090626+lfs/http.so

I'am really not sure which of the php.ini files above is the really correct one.

PS: Sources of zlib, libcurl and libevent if you need to download them manually:
zlib:           http://zlib.net/zlib-1.2.8.tar.gz
libcurl:     http://curl.haxx.se/download/curl-7.35.0.tar.gz
libevent: https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
up
-1
ross dot carver at avantalytics dot com
10 months ago
on a amazon linux install with php54, you'll get errors using pecl_http 2.03 from the command line  unless you add the following to your php.ini file:

extension=json.so
extension=raphf.so
extension=propro.so
extension=http.so

also make sure chmod ug+x http.so (and any of the other extensions for that matter).

If you do this and get a warning about json.so being already loaded - its likely that there is a separate ini file for json  in /etc/php.d/json.ini where this line is included as well.  It is necessary that you comment out line in json.ini as it is being called second and causing the warning

environment - php-fpm / nginx

HTH
up
-4
Anonymous
3 years ago
On Fedora, I had to do 'yum install curl-devel' to avoid missing curl.h error.
up
-5
jjrp78 at yahoo dot com
4 years ago
in Ubuntu 10.10 I had to create this file:

/etc/php5/conf.d/http.ini

and add this line:

extension=http.so
up
-18
Anonymous
1 year ago
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/http.so' - /usr/lib64/php/modules/http.so: undefined symbol: php_iconv_string in Unknown on line 0
To Top