mdref.json config
[mdref/mdref-http] / http.md
1 # pecl/http
2
3 ## About:
4
5 Extended HTTP support. Again.
6
7 * Introduces the http namespace.
8 * PHP stream based message bodies.
9 * Encapsulated env request/response.
10 * Modular client support.
11
12 ## Installation:
13
14 This extension is hosted at [PECL](http://pecl.php.net) and can be installed with [PEAR](http://pear.php.net)'s pecl command:
15
16 # pecl install pecl_http
17
18 ## Dependencies:
19
20 pecl/http depends on a number of system libraries and PHP extensions for special features.
21
22 #### Required system libraries:
23
24 The following system libraries are required to build this extension:
25
26 zlib
27 : Provides gzip/zlib/deflate encoding.
28 Configure: `--with-http-zlib-dir`
29 Minimum version: 1.2.0.4
30 Install on Debian: `apt-get install zlib1g-dev`
31
32
33 #### Optional system libraries:
34
35 The following system libraries are optional and provide additional features:
36
37 libcurl
38 : Provides HTTP request functionality.
39 Configure: `--with-http-libcurl-dir`
40 Minimum version: 7.18.2
41 Install on Debian: `apt-get install libcurl4-openssl-dev`
42
43 libbrotli
44 : Provides brotli encoding.
45 Configure: `--with-http-libbrotli-dir`
46 Minimum version: 1.0
47 Install on Debian: `apt-get install libbrotli-dev`
48
49 libevent
50 : Internal event loop support for the HTTP client.
51 Configure: `--with-http-libevent-dir`
52 Minimum version: none
53 Install on Debian: `apt-get install libevent-dev`
54
55 libicu
56 : Provides IDNA2003 and/or IDNA2008 support in URLs.
57 Configure: `--with-http-libicu-dir`
58 Minimum version: none
59 Install on Debian: `apt-get install libicu-dev`
60
61 libidn
62 : Provides IDNA2003 support in URLs.
63 Configure: `--with-http-libidn-dir`
64 Minimum version: none
65 Install on Debian: `apt-get install libidn11-dev`
66
67 libidn2
68 : Provides IDNA2008 support in URLs.
69 Configure: `--with-http-libidn2-dir`
70 Minimum version: none
71 Install on Debian: `apt-get install libidn2-0-dev`
72
73 libidnkit
74 : Provides IDNA2003 support in URLs. Conflicts with libidnkit2.
75 Configure: `--with-http-libidnkit-dir`
76 Minimum version: none
77 Install on Debian: N/A
78
79 libidnkit2
80 : Provides IDNA2008 support in URLs. Conflicts with libidnkit.
81 Configure: `--with-http-libidnkit2-dir`
82 Minimum version: none
83 Install on Debian: N/A
84
85 ##### A note on IDNA libraries:
86
87 If configured with multiple IDNA libraries' support, there's a run-time precedence of ICU over GNU libidn, which in turn has precendence over idnkit. If neither IDNA2008, nor IDNA2003 is explicitly requested, IDNA2008 has precendence.
88
89 ##### A note on the CURL library:
90
91 There are usually different styles of SSL support for libcurl available, so you can choose between 'openssl' and f.e. 'nss' or 'gnutls' when installing libcurl.
92
93 ### PHP extensions:
94
95 This extension unconditionally depends on the pre-loaded presence of the following PHP extensions:
96
97 * raphf
98 * propro (only until < 4.0.0, resp. PHP 8)
99 * spl
100
101
102 If configured ```--with-http-shared-deps``` (default) it depends on the pre-loaded presence of the following extensions, as long as they were available at build time:
103
104 * hash
105 * iconv
106 * json (only until < 2.4.0)
107
108 Please ensure that all extension on which pecl/http depends, are loaded before it, e.g in your `php.ini`:
109
110 ; obligatory deps
111 extension = raphf.so
112 extension = propro.so (PHP < 8.0, ext-http < 3.0 only)
113
114 ; if shared deps were enabled
115 extension = hash.so
116 extension = iconv.so
117 extension = json.so
118
119 ; finally load pecl/http
120 extension = http.so
121
122
123 ## INI Directives:
124
125 * http.etag.mode = "crc32b"
126 Default hash method for dynamic response payloads to generate an ETag.
127
128 ## Stream Filters:
129
130 The http extension registers the ```http.*``` namespace for its stream filters. Provided stream filters are:
131
132 * http.chunked_decode
133 Decode a stream encoded with chunked transfer encoding.
134 * http.chunked_encode
135 Encode a stream with chunked transfer encoding.
136 * http.inflate
137 Decode a stream encoded with deflate/zlib/gzip encoding.
138 * http.deflate
139 Encode a stream with deflate/zlib/gzip encoding.
140
141 ## Changelog:
142
143 0. v2.0.4
144 * Dropped the pecl/event conflict.
145 0. v2.4.0
146 * Dropped the ext/json dependency.
147 0. v2.4.2
148 * Added libidn2 and libicu as fallback for IDNA support.
149 0. v2.6.0, v3.1.0
150 * Added idnkit-1 IDNA2003 support.
151 * Added idnkit-2 IDNA2008 support.
152 * Added ICU IDNA2008 support.
153 * Added explicit configuration options for each IDNA library.
154 0. v3.2.0
155 * Added brotli encoding support.