reference/curl/functions/curl-setopt.xml
0d3cf0dbf9bc908100103917f8485581c50bd36b
...
...
@@ -10,7 +10,7 @@
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
12
<type>bool</type><methodname>curl_setopt</methodname>
13
-
<methodparam><type>resource</type><parameter>ch</parameter></methodparam>
13
+
<methodparam><type>CurlHandle</type><parameter>handle</parameter></methodparam>
14
14
<methodparam><type>int</type><parameter>option</parameter></methodparam>
15
15
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
16
16
</methodsynopsis>
...
...
@@ -28,7 +28,7 @@
28
28
<term><parameter>option</parameter></term>
29
29
<listitem>
30
30
<para>
31
-
The <literal>CURLOPT_XXX</literal> option to set.
31
+
The <constant>CURLOPT_<replaceable>*</replaceable></constant> option to set.
32
32
</para>
33
33
</listitem>
34
34
</varlistentry>
...
...
@@ -37,2247 +37,9 @@
37
37
<listitem>
38
38
<para>
39
39
The value to be set on <parameter>option</parameter>.
40
-
</para>
41
-
<para>
42
-
<parameter>value</parameter> should be a <type>bool</type> for the
43
-
following values of the <parameter>option</parameter> parameter:
44
-
<informaltable>
45
-
<tgroup cols="3">
46
-
<thead>
47
-
<row>
48
-
<entry valign="top">Option</entry>
49
-
<entry valign="top">Set <parameter>value</parameter> to</entry>
50
-
<entry valign="top">Notes</entry>
51
-
</row>
52
-
</thead>
53
-
<tbody>
54
-
<row>
55
-
<entry valign="top"><constant>CURLOPT_AUTOREFERER</constant></entry>
56
-
<entry valign="top">
57
-
&true; to automatically set the <literal>Referer:</literal> field in
58
-
requests where it follows a <literal>Location:</literal> redirect.
59
-
</entry>
60
-
<entry valign="top">
61
-
</entry>
62
-
</row>
63
-
<row>
64
-
<entry valign="top"><constant>CURLOPT_BINARYTRANSFER</constant></entry>
65
-
<entry valign="top">
66
-
&true; to return the raw output when
67
-
<constant>CURLOPT_RETURNTRANSFER</constant> is used.
68
-
</entry>
69
-
<entry valign="top">
70
-
From PHP 5.1.3, this option has no effect: the raw output will
71
-
always be returned when
72
-
<constant>CURLOPT_RETURNTRANSFER</constant> is used.
73
-
</entry>
74
-
</row>
75
-
<row>
76
-
<entry valign="top"><constant>CURLOPT_COOKIESESSION</constant></entry>
77
-
<entry valign="top">
78
-
&true; to mark this as a new cookie "session". It will force libcurl
79
-
to ignore all cookies it is about to load that are "session cookies"
80
-
from the previous session. By default, libcurl always stores and
81
-
loads all cookies, independent if they are session cookies or not.
82
-
Session cookies are cookies without expiry date and they are meant
83
-
to be alive and existing for this "session" only.
84
-
</entry>
85
-
<entry valign="top">
86
-
</entry>
87
-
</row>
88
-
<row>
89
-
<entry valign="top"><constant>CURLOPT_CERTINFO</constant></entry>
90
-
<entry valign="top">
91
-
&true; to output SSL certification information to <literal>STDERR</literal>
92
-
on secure transfers.
93
-
</entry>
94
-
<entry valign="top">
95
-
Added in cURL 7.19.1.
96
-
Available since PHP 5.3.2.
97
-
Requires <constant>CURLOPT_VERBOSE</constant> to be on to have an effect.
98
-
</entry>
99
-
</row>
100
-
<row>
101
-
<entry valign="top"><constant>CURLOPT_CONNECT_ONLY</constant></entry>
102
-
<entry valign="top">
103
-
&true; tells the library to perform all the required proxy authentication
104
-
and connection setup, but no data transfer. This option is implemented for
105
-
HTTP, SMTP and POP3.
106
-
</entry>
107
-
<entry valign="top">
108
-
Added in 7.15.2.
109
-
Available since PHP 5.5.0.
110
-
</entry>
111
-
</row>
112
-
<row>
113
-
<entry valign="top"><constant>CURLOPT_CRLF</constant></entry>
114
-
<entry valign="top">
115
-
&true; to convert Unix newlines to CRLF newlines
116
-
on transfers.
117
-
</entry>
118
-
<entry valign="top">
119
-
</entry>
120
-
</row>
121
-
<row>
122
-
<entry valign="top"><constant>CURLOPT_DISALLOW_USERNAME_IN_URL</constant></entry>
123
-
<entry valign="top">
124
-
&true; to not allow URLs that include a username. Usernames are allowed by default (0).
125
-
</entry>
126
-
<entry valign="top">
127
-
Added in cURL 7.61.0. Available since PHP 7.3.0.
128
-
</entry>
129
-
</row>
130
-
<row>
131
-
<entry valign="top"><constant>CURLOPT_DNS_SHUFFLE_ADDRESSES</constant></entry>
132
-
<entry valign="top">
133
-
&true; to shuffle the order of all returned addresses so that they will be used
134
-
in a random order, when a name is resolved and more than one IP address is returned.
135
-
This may cause IPv4 to be used before IPv6 or vice versa.
136
-
</entry>
137
-
<entry valign="top">
138
-
Added in cURL 7.60.0. Available since PHP 7.3.0.
139
-
</entry>
140
-
</row>
141
-
<row>
142
-
<entry valign="top"><constant>CURLOPT_HAPROXYPROTOCOL</constant></entry>
143
-
<entry valign="top">
144
-
&true; to send an HAProxy PROXY protocol v1 header at the start of the connection.
145
-
The default action is not to send this header.
146
-
</entry>
147
-
<entry valign="top">
148
-
Added in cURL 7.60.0. Available since PHP 7.3.0.
149
-
</entry>
150
-
</row>
151
-
<row>
152
-
<entry valign="top"><constant>CURLOPT_SSH_COMPRESSION</constant></entry>
153
-
<entry valign="top">
154
-
&true; to enable built-in SSH compression. This is a request, not an order;
155
-
the server may or may not do it.
156
-
</entry>
157
-
<entry valign="top">
158
-
Added in cURL 7.56.0. Available since PHP 7.3.0.
159
-
</entry>
160
-
</row>
161
-
<row>
162
-
<entry valign="top"><constant>CURLOPT_DNS_USE_GLOBAL_CACHE</constant></entry>
163
-
<entry valign="top">
164
-
&true; to use a global DNS cache. This option is not thread-safe.
165
-
It is conditionally enabled by default if PHP is built for non-threaded use
166
-
(CLI, FCGI, Apache2-Prefork, etc.).
167
-
</entry>
168
-
<entry valign="top">
169
-
</entry>
170
-
</row>
171
-
<row>
172
-
<entry valign="top"><constant>CURLOPT_FAILONERROR</constant></entry>
173
-
<entry valign="top">
174
-
&true; to fail verbosely if the HTTP code returned
175
-
is greater than or equal to 400. The default behavior is to return
176
-
the page normally, ignoring the code.
177
-
</entry>
178
-
<entry valign="top">
179
-
</entry>
180
-
</row>
181
-
<row>
182
-
<entry valign="top"><constant>CURLOPT_SSL_FALSESTART</constant></entry>
183
-
<entry valign="top">
184
-
&true; to enable TLS false start.
185
-
</entry>
186
-
<entry valign="top">
187
-
Added in cURL 7.42.0. Available since PHP 7.0.7.
188
-
</entry>
189
-
</row>
190
-
<row>
191
-
<entry valign="top"><constant>CURLOPT_FILETIME</constant></entry>
192
-
<entry valign="top">
193
-
&true; to attempt to retrieve the modification
194
-
date of the remote document. This value can be retrieved using
195
-
the <constant>CURLINFO_FILETIME</constant> option with
196
-
<function>curl_getinfo</function>.
197
-
</entry>
198
-
<entry valign="top">
199
-
</entry>
200
-
</row>
201
-
<row>
202
-
<entry valign="top"><constant>CURLOPT_FOLLOWLOCATION</constant></entry>
203
-
<entry valign="top">
204
-
&true; to follow any
205
-
<literal>"Location: "</literal> header that the server sends as
206
-
part of the HTTP header (note this is recursive, PHP will follow as
207
-
many <literal>"Location: "</literal> headers that it is sent,
208
-
unless <constant>CURLOPT_MAXREDIRS</constant> is set).
209
-
</entry>
210
-
<entry valign="top">
211
-
</entry>
212
-
</row>
213
-
<row>
214
-
<entry valign="top"><constant>CURLOPT_FORBID_REUSE</constant></entry>
215
-
<entry valign="top">
216
-
&true; to force the connection to explicitly
217
-
close when it has finished processing, and not be pooled for reuse.
218
-
</entry>
219
-
<entry valign="top">
220
-
</entry>
221
-
</row>
222
-
<row>
223
-
<entry valign="top"><constant>CURLOPT_FRESH_CONNECT</constant></entry>
224
-
<entry valign="top">
225
-
&true; to force the use of a new connection
226
-
instead of a cached one.
227
-
</entry>
228
-
<entry valign="top">
229
-
</entry>
230
-
</row>
231
-
<row>
232
-
<entry valign="top"><constant>CURLOPT_FTP_USE_EPRT</constant></entry>
233
-
<entry valign="top">
234
-
&true; to use EPRT (and LPRT) when doing active
235
-
FTP downloads. Use &false; to disable EPRT and LPRT and use PORT
236
-
only.
237
-
</entry>
238
-
<entry valign="top">
239
-
</entry>
240
-
</row>
241
-
<row>
242
-
<entry valign="top"><constant>CURLOPT_FTP_USE_EPSV</constant></entry>
243
-
<entry valign="top">
244
-
&true; to first try an EPSV command for FTP
245
-
transfers before reverting back to PASV. Set to &false;
246
-
to disable EPSV.
247
-
</entry>
248
-
<entry valign="top">
249
-
</entry>
250
-
</row>
251
-
<row>
252
-
<entry valign="top"><constant>CURLOPT_FTP_CREATE_MISSING_DIRS</constant></entry>
253
-
<entry valign="top">
254
-
&true; to create missing directories when an FTP operation
255
-
encounters a path that currently doesn't exist.
256
-
</entry>
257
-
<entry valign="top">
258
-
</entry>
259
-
</row>
260
-
<row>
261
-
<entry valign="top"><constant>CURLOPT_FTPAPPEND</constant></entry>
262
-
<entry valign="top">
263
-
&true; to append to the remote file instead of
264
-
overwriting it.
265
-
</entry>
266
-
<entry valign="top">
267
-
</entry>
268
-
</row>
269
-
<row>
270
-
<entry valign="top"><constant>CURLOPT_TCP_NODELAY</constant></entry>
271
-
<entry valign="top">
272
-
&true; to disable TCP's Nagle algorithm, which tries to minimize
273
-
the number of small packets on the network.
274
-
</entry>
275
-
<entry valign="top">
276
-
Available since PHP 5.2.1 for versions compiled with libcurl 7.11.2 or
277
-
greater.
278
-
</entry>
279
-
</row>
280
-
<row>
281
-
<entry valign="top"><constant>CURLOPT_FTPASCII</constant></entry>
282
-
<entry valign="top">
283
-
An alias of
284
-
<constant>CURLOPT_TRANSFERTEXT</constant>. Use that instead.
285
-
</entry>
286
-
<entry valign="top">
287
-
</entry>
288
-
</row>
289
-
<row>
290
-
<entry valign="top"><constant>CURLOPT_FTPLISTONLY</constant></entry>
291
-
<entry valign="top">
292
-
&true; to only list the names of an FTP
293
-
directory.
294
-
</entry>
295
-
<entry valign="top">
296
-
</entry>
297
-
</row>
298
-
<row>
299
-
<entry valign="top"><constant>CURLOPT_HEADER</constant></entry>
300
-
<entry valign="top">
301
-
&true; to include the header in the output.
302
-
</entry>
303
-
<entry valign="top">
304
-
</entry>
305
-
</row>
306
-
<row>
307
-
<entry><constant>CURLINFO_HEADER_OUT</constant></entry>
308
-
<entry valign="top">
309
-
&true; to track the handle's request string.
310
-
</entry>
311
-
<entry valign="top">
312
-
Available since PHP 5.1.3. The <constant>CURLINFO_</constant>
313
-
prefix is intentional.
314
-
</entry>
315
-
</row>
316
-
<row>
317
-
<entry valign="top"><constant>CURLOPT_HTTP09_ALLOWED </constant></entry>
318
-
<entry valign="top">
319
-
Whether to allow HTTP/0.9 responses. Defaults to &false; as of libcurl 7.66.0;
320
-
formerly it defaulted to &true;.
321
-
</entry>
322
-
<entry valign="top">
323
-
Available since PHP 7.3.15 and 7.4.3, respectively, if built against libcurl >= 7.64.0
324
-
</entry>
325
-
</row>
326
-
<row>
327
-
<entry valign="top"><constant>CURLOPT_HTTPGET</constant></entry>
328
-
<entry valign="top">
329
-
&true; to reset the HTTP request method to GET.
330
-
Since GET is the default, this is only necessary if the request
331
-
method has been changed.
332
-
</entry>
333
-
<entry valign="top">
334
-
</entry>
335
-
</row>
336
-
<row>
337
-
<entry valign="top"><constant>CURLOPT_HTTPPROXYTUNNEL</constant></entry>
338
-
<entry valign="top">
339
-
&true; to tunnel through a given HTTP proxy.
340
-
</entry>
341
-
<entry valign="top">
342
-
</entry>
343
-
</row>
344
-
<row>
345
-
<entry valign="top"><constant>CURLOPT_HTTP_CONTENT_DECODING</constant></entry>
346
-
<entry valign="top">
347
-
&false; to get the raw HTTP response body.
348
-
</entry>
349
-
<entry valign="top">
350
-
Available as of PHP 5.5.0 if built against libcurl >= 7.16.2.
351
-
</entry>
352
-
</row>
353
-
<row>
354
-
<entry valign="top"><constant>CURLOPT_KEEP_SENDING_ON_ERROR</constant></entry>
355
-
<entry valign="top">
356
-
&true; to keep sending the request body if the HTTP code returned is
357
-
equal to or larger than 300. The default action would be to stop sending
358
-
and close the stream or connection. Suitable for manual NTLM authentication.
359
-
Most applications do not need this option.
360
-
</entry>
361
-
<entry valign="top">
362
-
Available as of PHP 7.3.0 if built against libcurl >= 7.51.0.
363
-
</entry>
364
-
</row>
365
-
<row>
366
-
<entry valign="top"><constant>CURLOPT_MUTE</constant></entry>
367
-
<entry valign="top">
368
-
&true; to be completely silent with regards to
369
-
the cURL functions.
370
-
</entry>
371
-
<entry valign="top">
372
-
Removed in cURL 7.15.5 (You can use CURLOPT_RETURNTRANSFER instead)
373
-
</entry>
374
-
</row>
375
-
<row>
376
-
<entry valign="top"><constant>CURLOPT_NETRC</constant></entry>
377
-
<entry valign="top">
378
-
&true; to scan the <filename>~/.netrc</filename>
379
-
file to find a username and password for the remote site that
380
-
a connection is being established with.
381
-
</entry>
382
-
<entry valign="top">
383
-
</entry>
384
-
</row>
385
-
<row>
386
-
<entry valign="top"><constant>CURLOPT_NOBODY</constant></entry>
387
-
<entry valign="top">
388
-
&true; to exclude the body from the output.
389
-
Request method is then set to HEAD. Changing this to &false; does
390
-
not change it to GET.
391
-
</entry>
392
-
<entry valign="top">
393
-
</entry>
394
-
</row>
395
-
<row>
396
-
<entry valign="top"><constant>CURLOPT_NOPROGRESS</constant></entry>
397
-
<entry valign="top"><para>
398
-
&true; to disable the progress meter for cURL transfers.
399
-
<note>
400
-
<para>
401
-
PHP automatically sets this option to &true;, this should only be
402
-
changed for debugging purposes.
403
-
</para>
404
-
</note>
405
-
</para></entry>
406
-
<entry valign="top">
407
-
</entry>
408
-
</row>
409
-
<row>
410
-
<entry valign="top"><constant>CURLOPT_NOSIGNAL</constant></entry>
411
-
<entry valign="top">
412
-
&true; to ignore any cURL function that causes a
413
-
signal to be sent to the PHP process. This is turned on by default
414
-
in multi-threaded SAPIs so timeout options can still be used.
415
-
</entry>
416
-
<entry valign="top">
417
-
Added in cURL 7.10.
418
-
</entry>
419
-
</row>
420
-
<row>
421
-
<entry valign="top"><constant>CURLOPT_PATH_AS_IS</constant></entry>
422
-
<entry valign="top">
423
-
&true; to not handle dot dot sequences.
424
-
</entry>
425
-
<entry valign="top">
426
-
Added in cURL 7.42.0. Available since PHP 7.0.7.
427
-
</entry>
428
-
</row>
429
-
<row>
430
-
<entry valign="top"><constant>CURLOPT_PIPEWAIT</constant></entry>
431
-
<entry valign="top">
432
-
&true; to wait for pipelining/multiplexing.
433
-
</entry>
434
-
<entry valign="top">
435
-
Added in cURL 7.43.0. Available since PHP 7.0.7.
436
-
</entry>
437
-
</row>
438
-
<row>
439
-
<entry valign="top"><constant>CURLOPT_POST</constant></entry>
440
-
<entry valign="top">
441
-
&true; to do a regular HTTP POST. This POST is the
442
-
normal <literal>application/x-www-form-urlencoded</literal> kind,
443
-
most commonly used by HTML forms.
444
-
</entry>
445
-
<entry valign="top">
446
-
</entry>
447
-
</row>
448
-
<row>
449
-
<entry valign="top"><constant>CURLOPT_PUT</constant></entry>
450
-
<entry valign="top">
451
-
&true; to HTTP PUT a file. The file to PUT must
452
-
be set with <constant>CURLOPT_INFILE</constant> and
453
-
<constant>CURLOPT_INFILESIZE</constant>.
454
-
</entry>
455
-
<entry valign="top">
456
-
</entry>
457
-
</row>
458
-
<row>
459
-
<entry valign="top"><constant>CURLOPT_RETURNTRANSFER</constant></entry>
460
-
<entry valign="top">
461
-
&true; to return the transfer as a string of the
462
-
return value of <function>curl_exec</function> instead of outputting
463
-
it directly.
464
-
</entry>
465
-
<entry valign="top">
466
-
</entry>
467
-
</row>
468
-
<row>
469
-
<entry valign="top"><constant>CURLOPT_SAFE_UPLOAD</constant></entry>
470
-
<entry valign="top">
471
-
&true; to disable support for the <literal>@</literal> prefix for
472
-
uploading files in <constant>CURLOPT_POSTFIELDS</constant>, which
473
-
means that values starting with <literal>@</literal> can be safely
474
-
passed as fields. <classname>CURLFile</classname> may be used for
475
-
uploads instead.
476
-
</entry>
477
-
<entry valign="top">
478
-
Added in PHP 5.5.0 with &false; as the default value. PHP 5.6.0
479
-
changes the default value to &true;. PHP 7 removes this option;
480
-
the CURLFile interface must be used to upload files.
481
-
</entry>
482
-
</row>
483
-
<row>
484
-
<entry valign="top"><constant>CURLOPT_SASL_IR</constant></entry>
485
-
<entry valign="top">
486
-
&true; to enable sending the initial response in the first packet.
487
-
</entry>
488
-
<entry valign="top">
489
-
Added in cURL 7.31.10. Available since PHP 7.0.7.
490
-
</entry>
491
-
</row>
492
-
<row>
493
-
<entry valign="top"><constant>CURLOPT_SSL_ENABLE_ALPN</constant></entry>
494
-
<entry valign="top">
495
-
&false; to disable ALPN in the SSL handshake (if the SSL backend
496
-
libcurl is built to use supports it), which can be used to
497
-
negotiate http2.
498
-
</entry>
499
-
<entry valign="top">
500
-
Added in cURL 7.36.0. Available since PHP 7.0.7.
501
-
</entry>
502
-
</row>
503
-
<row>
504
-
<entry valign="top"><constant>CURLOPT_SSL_ENABLE_NPN</constant></entry>
505
-
<entry valign="top">
506
-
&false; to disable NPN in the SSL handshake (if the SSL backend
507
-
libcurl is built to use supports it), which can be used to
508
-
negotiate http2.
509
-
</entry>
510
-
<entry valign="top">
511
-
Added in cURL 7.36.0. Available since PHP 7.0.7.
512
-
</entry>
513
-
</row>
514
-
<row>
515
-
<entry valign="top"><constant>CURLOPT_SSL_VERIFYPEER</constant></entry>
516
-
<entry valign="top">
517
-
&false; to stop cURL from verifying the peer's
518
-
certificate. Alternate certificates to verify against can be
519
-
specified with the <constant>CURLOPT_CAINFO</constant> option
520
-
or a certificate directory can be specified with the
521
-
<constant>CURLOPT_CAPATH</constant> option.
522
-
</entry>
523
-
<entry valign="top">
524
-
&true; by default as of cURL 7.10. Default bundle installed as of
525
-
cURL 7.10.
526
-
</entry>
527
-
</row>
528
-
<row>
529
-
<entry valign="top"><constant>CURLOPT_SSL_VERIFYSTATUS</constant></entry>
530
-
<entry valign="top">
531
-
&true; to verify the certificate's status.
532
-
</entry>
533
-
<entry valign="top">
534
-
Added in cURL 7.41.0. Available since PHP 7.0.7.
535
-
</entry>
536
-
</row>
537
-
<row>
538
-
<entry valign="top"><constant>CURLOPT_PROXY_SSL_VERIFYPEER</constant></entry>
539
-
<entry valign="top">
540
-
&false; to stop cURL from verifying the peer's certificate.
541
-
Alternate certificates to verify against can be
542
-
specified with the <constant>CURLOPT_CAINFO</constant> option
543
-
or a certificate directory can be specified with the
544
-
<constant>CURLOPT_CAPATH</constant> option.
545
-
When set to false, the peer certificate verification succeeds regardless.
546
-
</entry>
547
-
<entry valign="top">
548
-
&true; by default. Available since PHP 7.3.0 and libcurl >= cURL 7.52.0.
549
-
</entry>
550
-
</row>
551
-
<row>
552
-
<entry valign="top"><constant>CURLOPT_SUPPRESS_CONNECT_HEADERS</constant></entry>
553
-
<entry valign="top">
554
-
&true; to suppress proxy CONNECT response headers from the user callback functions
555
-
<constant>CURLOPT_HEADERFUNCTION</constant> and <constant>CURLOPT_WRITEFUNCTION</constant>,
556
-
when <constant>CURLOPT_HTTPPROXYTUNNEL</constant> is used and a CONNECT request is made.
557
-
</entry>
558
-
<entry valign="top">
559
-
Added in cURL 7.54.0. Available since PHP 7.3.0.
560
-
</entry>
561
-
</row>
562
-
<row>
563
-
<entry valign="top"><constant>CURLOPT_TCP_FASTOPEN</constant></entry>
564
-
<entry valign="top">
565
-
&true; to enable TCP Fast Open.
566
-
</entry>
567
-
<entry valign="top">
568
-
Added in cURL 7.49.0. Available since PHP 7.0.7.
569
-
</entry>
570
-
</row>
571
-
<row>
572
-
<entry valign="top"><constant>CURLOPT_TFTP_NO_OPTIONS</constant></entry>
573
-
<entry valign="top">
574
-
&true; to not send TFTP options requests.
575
-
</entry>
576
-
<entry valign="top">
577
-
Added in cURL 7.48.0. Available since PHP 7.0.7.
578
-
</entry>
579
-
</row>
580
-
<row>
581
-
<entry valign="top"><constant>CURLOPT_TRANSFERTEXT</constant></entry>
582
-
<entry valign="top">
583
-
&true; to use ASCII mode for FTP transfers.
584
-
For LDAP, it retrieves data in plain text instead of HTML. On
585
-
Windows systems, it will not set <literal>STDOUT</literal> to binary
586
-
mode.
587
-
</entry>
588
-
<entry valign="top">
589
-
</entry>
590
-
</row>
591
-
<row>
592
-
<entry valign="top"><constant>CURLOPT_UNRESTRICTED_AUTH</constant></entry>
593
-
<entry valign="top">
594
-
&true; to keep sending the username and password
595
-
when following locations (using
596
-
<constant>CURLOPT_FOLLOWLOCATION</constant>), even when the
597
-
hostname has changed.
598
-
</entry>
599
-
<entry valign="top">
600
-
</entry>
601
-
</row>
602
-
<row>
603
-
<entry valign="top"><constant>CURLOPT_UPLOAD</constant></entry>
604
-
<entry valign="top">
605
-
&true; to prepare for an upload.
606
-
</entry>
607
-
<entry valign="top">
608
-
</entry>
609
-
</row>
610
-
<row>
611
-
<entry valign="top"><constant>CURLOPT_VERBOSE</constant></entry>
612
-
<entry valign="top">
613
-
&true; to output verbose information. Writes
614
-
output to <literal>STDERR</literal>, or the file specified using
615
-
<constant>CURLOPT_STDERR</constant>.
616
-
</entry>
617
-
<entry valign="top">
618
-
</entry>
619
-
</row>
620
-
</tbody>
621
-
</tgroup>
622
-
</informaltable>
623
-
</para>
624
-
<para>
625
-
<parameter>value</parameter> should be an <type>integer</type> for the
626
-
following values of the <parameter>option</parameter> parameter:
627
-
<informaltable>
628
-
<tgroup cols="3">
629
-
<thead>
630
-
<row>
631
-
<entry>Option</entry>
632
-
<entry>Set <parameter>value</parameter> to</entry>
633
-
<entry>Notes</entry>
634
-
</row>
635
-
</thead>
636
-
<tbody>
637
-
<row>
638
-
<entry valign="top"><constant>CURLOPT_BUFFERSIZE</constant></entry>
639
-
<entry valign="top">
640
-
The size of the buffer to use for each read. There is no guarantee
641
-
this request will be fulfilled, however.
642
-
</entry>
643
-
<entry valign="top">
644
-
Added in cURL 7.10.
645
-
</entry>
646
-
</row>
647
-
<row>
648
-
<entry valign="top"><constant>CURLOPT_CLOSEPOLICY</constant></entry>
649
-
<entry valign="top">
650
-
One of the <constant>CURLCLOSEPOLICY_*</constant> values.
651
-
<note>
652
-
<para>
653
-
This option is deprecated, as it was never implemented in cURL and
654
-
never had any effect.
655
-
</para>
656
-
</note>
657
-
</entry>
658
-
<entry valign="top">
659
-
Removed in PHP 5.6.0.
660
-
</entry>
661
-
</row>
662
-
<row>
663
-
<entry><constant>CURLOPT_CONNECTTIMEOUT</constant></entry>
664
-
<entry valign="top">
665
-
The number of seconds to wait while trying to connect. Use 0 to
666
-
wait indefinitely.
667
-
</entry>
668
-
<entry valign="top">
669
-
</entry>
670
-
</row>
671
-
<row>
672
-
<entry valign="top"><constant>CURLOPT_CONNECTTIMEOUT_MS</constant></entry>
673
-
<entry valign="top">
674
-
The number of milliseconds to wait while trying to connect. Use 0 to
675
-
wait indefinitely.
676
-
<!-- http://curl.haxx.se/libcurl/c/curl_easy_setopt.html -->
677
-
If libcurl is built to use the standard system name resolver, that
678
-
portion of the connect will still use full-second resolution for
679
-
timeouts with a minimum timeout allowed of one second.
680
-
</entry>
681
-
<entry valign="top">
682
-
Added in cURL 7.16.2. Available since PHP 5.2.3.
683
-
</entry>
684
-
</row>
685
-
<row>
686
-
<entry valign="top"><constant>CURLOPT_DNS_CACHE_TIMEOUT</constant></entry>
687
-
<entry valign="top">
688
-
The number of seconds to keep DNS entries in memory. This
689
-
option is set to 120 (2 minutes) by default.
690
-
</entry>
691
-
<entry valign="top">
692
-
</entry>
693
-
</row>
694
-
<row>
695
-
<entry valign="top"><constant>CURLOPT_EXPECT_100_TIMEOUT_MS</constant></entry>
696
-
<entry valign="top">
697
-
The timeout for Expect: 100-continue responses in milliseconds.
698
-
Defaults to 1000 milliseconds.
699
-
</entry>
700
-
<entry valign="top">
701
-
Added in cURL 7.36.0. Available since PHP 7.0.7.
702
-
</entry>
703
-
</row>
704
-
<row>
705
-
<entry valign="top"><constant>CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS</constant></entry>
706
-
<entry valign="top">
707
-
Head start for ipv6 for the happy eyeballs algorithm. Happy eyeballs attempts
708
-
to connect to both IPv4 and IPv6 addresses for dual-stack hosts,
709
-
preferring IPv6 first for timeout milliseconds.
710
-
Defaults to CURL_HET_DEFAULT, which is currently 200 milliseconds.
711
-
</entry>
712
-
<entry valign="top">
713
-
Added in cURL 7.59.0. Available since PHP 7.3.0.
714
-
</entry>
715
-
</row>
716
-
<row>
717
-
<entry valign="top"><constant>CURLOPT_FTPSSLAUTH</constant></entry>
718
-
<entry valign="top">
719
-
The FTP authentication method (when is activated):
720
-
<literal>CURLFTPAUTH_SSL</literal> (try SSL first),
721
-
<literal>CURLFTPAUTH_TLS</literal> (try TLS first), or
722
-
<literal>CURLFTPAUTH_DEFAULT</literal> (let cURL decide).
723
-
</entry>
724
-
<entry valign="top">
725
-
Added in cURL 7.12.2.
726
-
</entry>
727
-
</row>
728
-
<row>
729
-
<entry valign="top"><constant>CURLOPT_HEADEROPT</constant></entry>
730
-
<entry valign="top">
731
-
How to deal with headers. One of the following constants:
732
-
<simpara>
733
-
<constant>CURLHEADER_UNIFIED</constant>: the headers specified in
734
-
<constant>CURLOPT_HTTPHEADER</constant> will be used in requests
735
-
both to servers and proxies. With this option enabled,
736
-
<constant>CURLOPT_PROXYHEADER</constant> will not have any effect.
737
-
</simpara>
738
-
<simpara>
739
-
<constant>CURLHEADER_SEPARATE</constant>: makes
740
-
<constant>CURLOPT_HTTPHEADER</constant> headers only get sent to
741
-
a server and not to a proxy. Proxy headers must be set with
742
-
<constant>CURLOPT_PROXYHEADER</constant> to get used. Note that if
743
-
a non-CONNECT request is sent to a proxy, libcurl will send both
744
-
server headers and proxy headers. When doing CONNECT, libcurl will
745
-
send <constant>CURLOPT_PROXYHEADER</constant> headers only to the
746
-
proxy and then <constant>CURLOPT_HTTPHEADER</constant> headers
747
-
only to the server.
748
-
</simpara>
749
-
<simpara>
750
-
Defaults to <constant>CURLHEADER_SEPARATE</constant> as of cURL
751
-
7.42.1, and <constant>CURLHEADER_UNIFIED</constant> before.
752
-
</simpara>
753
-
</entry>
754
-
<entry valign="top">
755
-
Added in cURL 7.37.0. Available since PHP 7.0.7.
756
-
</entry>
757
-
</row>
758
-
<row>
759
-
<entry valign="top"><constant>CURLOPT_HTTP_VERSION</constant></entry>
760
-
<entry valign="top">
761
-
<constant>CURL_HTTP_VERSION_NONE</constant> (default, lets CURL
762
-
decide which version to use),
763
-
<constant>CURL_HTTP_VERSION_1_0</constant> (forces HTTP/1.0),
764
-
<constant>CURL_HTTP_VERSION_1_1</constant> (forces HTTP/1.1),
765
-
<constant>CURL_HTTP_VERSION_2_0</constant> (attempts HTTP 2),
766
-
<constant>CURL_HTTP_VERSION_2 </constant> (alias of <constant>CURL_HTTP_VERSION_2_0</constant>),
767
-
<constant>CURL_HTTP_VERSION_2TLS</constant> (attempts HTTP 2 over TLS (HTTPS) only) or
768
-
<constant>CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE</constant> (issues non-TLS HTTP requests using HTTP/2 without HTTP/1.1 Upgrade).
769
-
</entry>
770
-
<entry valign="top">
771
-
</entry>
772
-
</row>
773
-
<row>
774
-
<entry valign="top"><constant>CURLOPT_HTTPAUTH</constant></entry>
775
-
<entry valign="top">
776
-
<para>
777
-
The HTTP authentication method(s) to use. The options are:
778
-
<constant>CURLAUTH_BASIC</constant>,
779
-
<constant>CURLAUTH_DIGEST</constant>,
780
-
<constant>CURLAUTH_GSSNEGOTIATE</constant>,
781
-
<constant>CURLAUTH_NTLM</constant>,
782
-
<constant>CURLAUTH_ANY</constant>, and
783
-
<constant>CURLAUTH_ANYSAFE</constant>.
784
-
</para>
785
-
<para>
786
-
The bitwise <literal>|</literal> (or) operator can be used to combine
787
-
more than one method. If this is done, cURL will poll the server to see
788
-
what methods it supports and pick the best one.
789
-
</para>
790
-
<para>
791
-
<constant>CURLAUTH_ANY</constant> is an alias for
792
-
<literal>CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM</literal>.
793
-
</para>
794
-
<para>
795
-
<constant>CURLAUTH_ANYSAFE</constant> is an alias for
796
-
<literal>CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM</literal>.
797
-
</para>
798
-
</entry>
799
-
<entry valign="top">
800
-
</entry>
801
-
</row>
802
-
<row>
803
-
<entry valign="top"><constant>CURLOPT_INFILESIZE</constant></entry>
804
-
<entry valign="top">
805
-
The expected size, in bytes, of the file when uploading a file to
806
-
a remote site. Note that using this option will not stop libcurl
807
-
from sending more data, as exactly what is sent depends on
808
-
<constant>CURLOPT_READFUNCTION</constant>.
809
-
</entry>
810
-
<entry valign="top">
811
-
</entry>
812
-
</row>
813
-
<row>
814
-
<entry valign="top"><constant>CURLOPT_LOW_SPEED_LIMIT</constant></entry>
815
-
<entry valign="top">
816
-
The transfer speed, in bytes per second, that the transfer should be
817
-
below during the count of <constant>CURLOPT_LOW_SPEED_TIME</constant>
818
-
seconds before PHP considers the transfer too slow and aborts.
819
-
</entry>
820
-
<entry valign="top">
821
-
</entry>
822
-
</row>
823
-
<row>
824
-
<entry valign="top"><constant>CURLOPT_LOW_SPEED_TIME</constant></entry>
825
-
<entry valign="top">
826
-
The number of seconds the transfer speed should be below
827
-
<constant>CURLOPT_LOW_SPEED_LIMIT</constant> before PHP considers
828
-
the transfer too slow and aborts.
829
-
</entry>
830
-
<entry valign="top">
831
-
</entry>
832
-
</row>
833
-
<row>
834
-
<entry valign="top"><constant>CURLOPT_MAXCONNECTS</constant></entry>
835
-
<entry valign="top">
836
-
The maximum amount of persistent connections that are allowed.
837
-
When the limit is reached,
838
-
<constant>CURLOPT_CLOSEPOLICY</constant> is used to determine
839
-
which connection to close.
840
-
</entry>
841
-
<entry valign="top">
842
-
</entry>
843
-
</row>
844
-
<row>
845
-
<entry valign="top"><constant>CURLOPT_MAXREDIRS</constant></entry>
846
-
<entry valign="top">
847
-
The maximum amount of HTTP redirections to follow. Use this option
848
-
alongside <constant>CURLOPT_FOLLOWLOCATION</constant>.
849
-
</entry>
850
-
<entry valign="top">
851
-
</entry>
852
-
</row>
853
-
<row>
854
-
<entry valign="top"><constant>CURLOPT_PORT</constant></entry>
855
-
<entry valign="top">
856
-
An alternative port number to connect to.
857
-
</entry>
858
-
<entry valign="top">
859
-
</entry>
860
-
</row>
861
-
<row>
862
-
<entry valign="top"><constant>CURLOPT_POSTREDIR</constant></entry>
863
-
<entry valign="top">
864
-
A bitmask of 1 (301 Moved Permanently), 2 (302 Found)
865
-
and 4 (303 See Other) if the HTTP POST method should be maintained
866
-
when <constant>CURLOPT_FOLLOWLOCATION</constant> is set and a
867
-
specific type of redirect occurs.
868
-
</entry>
869
-
<entry valign="top">
870
-
Added in cURL 7.19.1. Available since PHP 5.3.2.
871
-
</entry>
872
-
</row>
873
-
<row>
874
-
<entry valign="top"><constant>CURLOPT_PROTOCOLS</constant></entry>
875
-
<entry valign="top">
876
-
<para>
877
-
Bitmask of <constant>CURLPROTO_*</constant> values. If used, this bitmask
878
-
limits what protocols libcurl may use in the transfer. This allows you to have
879
-
a libcurl built to support a wide range of protocols but still limit specific
880
-
transfers to only be allowed to use a subset of them. By default libcurl will
881
-
accept all protocols it supports.
882
-
See also <constant>CURLOPT_REDIR_PROTOCOLS</constant>.
883
-
</para>
884
-
<para>
885
-
Valid protocol options are:
886
-
<constant>CURLPROTO_HTTP</constant>,
887
-
<constant>CURLPROTO_HTTPS</constant>,
888
-
<constant>CURLPROTO_FTP</constant>,
889
-
<constant>CURLPROTO_FTPS</constant>,
890
-
<constant>CURLPROTO_SCP</constant>,
891
-
<constant>CURLPROTO_SFTP</constant>,
892
-
<constant>CURLPROTO_TELNET</constant>,
893
-
<constant>CURLPROTO_LDAP</constant>,
894
-
<constant>CURLPROTO_LDAPS</constant>,
895
-
<constant>CURLPROTO_DICT</constant>,
896
-
<constant>CURLPROTO_FILE</constant>,
897
-
<constant>CURLPROTO_TFTP</constant>,
898
-
<constant>CURLPROTO_ALL</constant>
899
-
</para>
900
-
</entry>
901
-
<entry valign="top">
902
-
Added in cURL 7.19.4.
903
-
</entry>
904
-
</row>
905
-
<row>
906
-
<entry valign="top"><constant>CURLOPT_PROXYAUTH</constant></entry>
907
-
<entry valign="top">
908
-
The HTTP authentication method(s) to use for the proxy connection.
909
-
Use the same bitmasks as described in
910
-
<constant>CURLOPT_HTTPAUTH</constant>. For proxy authentication,
911
-
only <constant>CURLAUTH_BASIC</constant> and
912
-
<constant>CURLAUTH_NTLM</constant> are currently supported.
913
-
</entry>
914
-
<entry valign="top">
915
-
Added in cURL 7.10.7.
916
-
</entry>
917
-
</row>
918
-
<row>
919
-
<entry valign="top"><constant>CURLOPT_PROXYPORT</constant></entry>
920
-
<entry valign="top">
921
-
The port number of the proxy to connect to. This port number can
922
-
also be set in <constant>CURLOPT_PROXY</constant>.
923
-
</entry>
924
-
<entry valign="top">
925
-
</entry>
926
-
</row>
927
-
<row>
928
-
<entry valign="top"><constant>CURLOPT_PROXYTYPE</constant></entry>
929
-
<entry valign="top">
930
-
Either <constant>CURLPROXY_HTTP</constant> (default),
931
-
<constant>CURLPROXY_SOCKS4</constant>,
932
-
<constant>CURLPROXY_SOCKS5</constant>,
933
-
<constant>CURLPROXY_SOCKS4A</constant> or
934
-
<constant>CURLPROXY_SOCKS5_HOSTNAME</constant>.
935
-
</entry>
936
-
<entry valign="top">
937
-
Added in cURL 7.10.
938
-
</entry>
939
-
</row>
940
-
<row>
941
-
<entry valign="top"><constant>CURLOPT_REDIR_PROTOCOLS</constant></entry>
942
-
<entry valign="top">
943
-
Bitmask of <constant>CURLPROTO_*</constant> values. If used, this bitmask
944
-
limits what protocols libcurl may use in a transfer that it follows to in
945
-
a redirect when <constant>CURLOPT_FOLLOWLOCATION</constant> is enabled.
946
-
This allows you to limit specific transfers to only be allowed to use a subset
947
-
of protocols in redirections. By default libcurl will allow all protocols
948
-
except for FILE and SCP. This is a difference compared to pre-7.19.4 versions
949
-
which unconditionally would follow to all protocols supported.
950
-
See also <constant>CURLOPT_PROTOCOLS</constant> for protocol constant values.
951
-
</entry>
952
-
<entry valign="top">
953
-
Added in cURL 7.19.4.
954
-
</entry>
955
-
</row>
956
-
<row>
957
-
<entry valign="top"><constant>CURLOPT_RESUME_FROM</constant></entry>
958
-
<entry valign="top">
959
-
The offset, in bytes, to resume a transfer from.
960
-
</entry>
961
-
<entry valign="top">
962
-
</entry>
963
-
</row>
964
-
<row>
965
-
<entry valign="top"><constant>CURLOPT_SOCKS5_AUTH</constant></entry>
966
-
<entry valign="top">
967
-
<para>
968
-
The SOCKS5 authentication method(s) to use. The options are:
969
-
<constant>CURLAUTH_BASIC</constant>,
970
-
<constant>CURLAUTH_GSSAPI</constant>,
971
-
<constant>CURLAUTH_NONE</constant>.
972
-
</para>
973
-
<para>
974
-
The bitwise <literal>|</literal> (or) operator can be used to combine
975
-
more than one method. If this is done, cURL will poll the server to see
976
-
what methods it supports and pick the best one.
977
-
</para>
978
-
<para>
979
-
<constant>CURLAUTH_BASIC</constant> allows username/password authentication.
980
-
</para>
981
-
<para>
982
-
<constant>CURLAUTH_GSSAPI</constant> allows GSS-API authentication.
983
-
</para>
984
-
<para>
985
-
<constant>CURLAUTH_NONE</constant> allows no authentication.
986
-
</para>
987
-
<para>
988
-
Defaults to <literal>CURLAUTH_BASIC|CURLAUTH_GSSAPI</literal>.
989
-
Set the actual username and password with the <constant>CURLOPT_PROXYUSERPWD</constant> option.
990
-
</para>
991
-
</entry>
992
-
<entry valign="top">
993
-
Available as of 7.3.0 and curl >= 7.55.0.
994
-
</entry>
995
-
</row>
996
-
<row>
997
-
<entry valign="top"><constant>CURLOPT_SSL_OPTIONS</constant></entry>
998
-
<entry valign="top">
999
-
Set SSL behavior options, which is a bitmask of any of the following constants:
1000
-
<simpara>
1001
-
<constant>CURLSSLOPT_ALLOW_BEAST</constant>: do not attempt to use
1002
-
any workarounds for a security flaw in the SSL3 and TLS1.0 protocols.
1003
-
</simpara>
1004
-
<simpara>
1005
-
<constant>CURLSSLOPT_NO_REVOKE</constant>: disable certificate
1006
-
revocation checks for those SSL backends where such behavior is
1007
-
present.
1008
-
</simpara>
1009
-
</entry>
1010
-
<entry valign="top">
1011
-
Added in cURL 7.25.0. Available since PHP 7.0.7.
1012
-
</entry>
1013
-
</row>
1014
-
<row>
1015
-
<entry valign="top"><constant>CURLOPT_SSL_VERIFYHOST</constant></entry>
1016
-
<entry valign="top">
1017
-
<literal>1</literal> to check the existence of a common name in the
1018
-
SSL peer certificate. <literal>2</literal> to check the existence of
1019
-
a common name and also verify that it matches the hostname
1020
-
provided. <literal>0</literal> to not check the names. In production environments the value of this option
1021
-
should be kept at <literal>2</literal> (default value).
1022
-
</entry>
1023
-
<entry valign="top">
1024
-
Support for value <literal>1</literal> removed in cURL 7.28.1.
1025
-
</entry>
1026
-
</row>
1027
-
<row>
1028
-
<entry valign="top"><constant>CURLOPT_SSLVERSION</constant></entry>
1029
-
<entry valign="top">
1030
-
One of <constant>CURL_SSLVERSION_DEFAULT</constant> (0),
1031
-
<constant>CURL_SSLVERSION_TLSv1</constant> (1),
1032
-
<constant>CURL_SSLVERSION_SSLv2</constant> (2),
1033
-
<constant>CURL_SSLVERSION_SSLv3</constant> (3),
1034
-
<constant>CURL_SSLVERSION_TLSv1_0</constant> (4),
1035
-
<constant>CURL_SSLVERSION_TLSv1_1</constant> (5) or
1036
-
<constant>CURL_SSLVERSION_TLSv1_2</constant> (6).
1037
-
The maximum TLS version can be set by using one of the <constant>CURL_SSLVERSION_MAX_*</constant>
1038
-
constants. It is also possible to OR one of the <constant>CURL_SSLVERSION_*</constant>
1039
-
constants with one of the <constant>CURL_SSLVERSION_MAX_*</constant> constants.
1040
-
<constant>CURL_SSLVERSION_MAX_DEFAULT</constant> (the maximum version supported by the library),
1041
-
<constant>CURL_SSLVERSION_MAX_TLSv1_0</constant>,
1042
-
<constant>CURL_SSLVERSION_MAX_TLSv1_1</constant>,
1043
-
<constant>CURL_SSLVERSION_MAX_TLSv1_2</constant>, or
1044
-
<constant>CURL_SSLVERSION_MAX_TLSv1_3</constant>.
1045
-
<note>
1046
-
<para>
1047
-
Your best bet is to not set this and let it use the default.
1048
-
Setting it to 2 or 3 is very dangerous given the known
1049
-
vulnerabilities in SSLv2 and SSLv3.
1050
-
</para>
1051
-
</note>
1052
-
</entry>
1053
-
<entry valign="top">
1054
-
</entry>
1055
-
</row>
1056
-
<row>
1057
-
<entry valign="top"><constant>CURLOPT_PROXY_SSL_OPTIONS</constant></entry>
1058
-
<entry valign="top">
1059
-
Set proxy SSL behavior options, which is a bitmask of any of the following constants:
1060
-
<simpara>
1061
-
<constant>CURLSSLOPT_ALLOW_BEAST</constant>: do not attempt to use
1062
-
any workarounds for a security flaw in the SSL3 and TLS1.0 protocols.
1063
-
</simpara>
1064
-
<simpara>
1065
-
<constant>CURLSSLOPT_NO_REVOKE</constant>: disable certificate
1066
-
revocation checks for those SSL backends where such behavior is
1067
-
present. (curl >= 7.44.0)
1068
-
</simpara>
1069
-
<simpara>
1070
-
<constant>CURLSSLOPT_NO_PARTIALCHAIN</constant>: do not accept "partial"
1071
-
certificate chains, which it otherwise does by default. (curl >= 7.68.0)
1072
-
</simpara>
1073
-
</entry>
1074
-
<entry valign="top">
1075
-
Available since PHP 7.3.0 and libcurl >= cURL 7.52.0.
1076
-
</entry>
1077
-
</row>
1078
-
<row>
1079
-
<entry valign="top"><constant>CURLOPT_PROXY_SSL_VERIFYHOST</constant></entry>
1080
-
<entry valign="top">
1081
-
Set to <literal>2</literal> to verify in the HTTPS proxy's certificate name fields against the proxy name.
1082
-
When set to <literal>0</literal> the connection succeeds regardless of the names used in the certificate.
1083
-
Use that ability with caution!
1084
-
<literal>1</literal> treated as a debug option in curl 7.28.0 and earlier.
1085
-
From curl 7.28.1 to 7.65.3 <constant>CURLE_BAD_FUNCTION_ARGUMENT</constant> is returned.
1086
-
From curl 7.66.0 onwards <literal>1</literal> and <literal>2</literal> is treated as the same value.
1087
-
In production environments the value of this option should be kept at <literal>2</literal> (default value).
1088
-
</entry>
1089
-
<entry valign="top">
1090
-
Available since PHP 7.3.0 and libcurl >= cURL 7.52.0.
1091
-
</entry>
1092
-
</row>
1093
-
<row>
1094
-
<entry valign="top"><constant>CURLOPT_PROXY_SSLVERSION</constant></entry>
1095
-
<entry valign="top">
1096
-
One of <constant>CURL_SSLVERSION_DEFAULT</constant>,
1097
-
<constant>CURL_SSLVERSION_TLSv1</constant>,
1098
-
<constant>CURL_SSLVERSION_TLSv1_0</constant>,
1099
-
<constant>CURL_SSLVERSION_TLSv1_1</constant>,
1100
-
<constant>CURL_SSLVERSION_TLSv1_2</constant>,
1101
-
<constant>CURL_SSLVERSION_TLSv1_3</constant>,
1102
-
<constant>CURL_SSLVERSION_MAX_DEFAULT</constant>,
1103
-
<constant>CURL_SSLVERSION_MAX_TLSv1_0</constant>,
1104
-
<constant>CURL_SSLVERSION_MAX_TLSv1_1</constant>,
1105
-
<constant>CURL_SSLVERSION_MAX_TLSv1_2</constant>,
1106
-
<constant>CURL_SSLVERSION_MAX_TLSv1_3</constant> or
1107
-
<constant>CURL_SSLVERSION_SSLv3</constant>.
1108
-
<note>
1109
-
<para>
1110
-
Your best bet is to not set this and let it use the default <constant>CURL_SSLVERSION_DEFAULT</constant>
1111
-
which will attempt to figure out the remote SSL protocol version.
1112
-
</para>
1113
-
</note>
1114
-
</entry>
1115
-
<entry valign="top">
1116
-
Available since PHP 7.3.0 and libcurl >= cURL 7.52.0.
1117
-
</entry>
1118
-
</row>
1119
-
<row>
1120
-
<entry valign="top"><constant>CURLOPT_STREAM_WEIGHT</constant></entry>
1121
-
<entry valign="top">
1122
-
Set the numerical stream weight (a number between 1 and 256).
1123
-
</entry>
1124
-
<entry valign="top">
1125
-
Added in cURL 7.46.0. Available since PHP 7.0.7.
1126
-
</entry>
1127
-
</row>
1128
-
<row>
1129
-
<entry valign="top"><constant>CURLOPT_TCP_KEEPALIVE</constant></entry>
1130
-
<entry valign="top">
1131
-
If set to <literal>1</literal>, TCP keepalive probes will be sent. The delay and
1132
-
frequency of these probes can be controlled by the <constant>CURLOPT_TCP_KEEPIDLE</constant>
1133
-
and <constant>CURLOPT_TCP_KEEPINTVL</constant> options, provided the operating system
1134
-
supports them. If set to <literal>0</literal> (default) keepalive probes are disabled.
1135
-
</entry>
1136
-
<entry valign="top">
1137
-
Added in cURL 7.25.0. Available since PHP 5.5.0.
1138
-
</entry>
1139
-
</row>
1140
-
<row>
1141
-
<entry valign="top"><constant>CURLOPT_TCP_KEEPIDLE</constant></entry>
1142
-
<entry valign="top">
1143
-
Sets the delay, in seconds, that the operating system will wait while the connection is
1144
-
idle before sending keepalive probes, if <constant>CURLOPT_TCP_KEEPALIVE</constant> is
1145
-
enabled. Not all operating systems support this option.
1146
-
The default is <literal>60</literal>.
1147
-
</entry>
1148
-
<entry valign="top">
1149
-
Added in cURL 7.25.0. Available since PHP 5.5.0.
1150
-
</entry>
1151
-
</row>
1152
-
<row>
1153
-
<entry valign="top"><constant>CURLOPT_TCP_KEEPINTVL</constant></entry>
1154
-
<entry valign="top">
1155
-
Sets the interval, in seconds, that the operating system will wait between sending
1156
-
keepalive probes, if <constant>CURLOPT_TCP_KEEPALIVE</constant> is enabled.
1157
-
Not all operating systems support this option.
1158
-
The default is <literal>60</literal>.
1159
-
</entry>
1160
-
<entry valign="top">
1161
-
Added in cURL 7.25.0. Available since PHP 5.5.0.
1162
-
</entry>
1163
-
</row>
1164
-
<row>
1165
-
<entry valign="top"><constant>CURLOPT_TIMECONDITION</constant></entry>
1166
-
<entry valign="top">
1167
-
How <constant>CURLOPT_TIMEVALUE</constant> is treated.
1168
-
Use <constant>CURL_TIMECOND_IFMODSINCE</constant> to return the
1169
-
page only if it has been modified since the time specified in
1170
-
<constant>CURLOPT_TIMEVALUE</constant>. If it hasn't been modified,
1171
-
a <literal>"304 Not Modified"</literal> header will be returned
1172
-
assuming <constant>CURLOPT_HEADER</constant> is &true;.
1173
-
Use <constant>CURL_TIMECOND_IFUNMODSINCE</constant> for the reverse
1174
-
effect. <constant>CURL_TIMECOND_IFMODSINCE</constant> is the
1175
-
default.
1176
-
</entry>
1177
-
<entry valign="top">
1178
-
</entry>
1179
-
</row>
1180
-
<row>
1181
-
<entry valign="top"><constant>CURLOPT_TIMEOUT</constant></entry>
1182
-
<entry valign="top">
1183
-
The maximum number of seconds to allow cURL functions to execute.
1184
-
</entry>
1185
-
<entry valign="top">
1186
-
</entry>
1187
-
</row>
1188
-
<row>
1189
-
<entry valign="top"><constant>CURLOPT_TIMEOUT_MS</constant></entry>
1190
-
<entry valign="top">
1191
-
The maximum number of milliseconds to allow cURL functions to
1192
-
execute.
1193
-
<!-- http://curl.haxx.se/libcurl/c/curl_easy_setopt.html -->
1194
-
If libcurl is built to use the standard system name resolver, that
1195
-
portion of the connect will still use full-second resolution for
1196
-
timeouts with a minimum timeout allowed of one second.
1197
-
</entry>
1198
-
<entry valign="top">
1199
-
Added in cURL 7.16.2. Available since PHP 5.2.3.
1200
-
</entry>
1201
-
</row>
1202
-
<row>
1203
-
<entry valign="top"><constant>CURLOPT_TIMEVALUE</constant></entry>
1204
-
<entry valign="top">
1205
-
The time in seconds since January 1st, 1970. The time will be used
1206
-
by <constant>CURLOPT_TIMECONDITION</constant>. By default,
1207
-
<constant>CURL_TIMECOND_IFMODSINCE</constant> is used.
1208
-
</entry>
1209
-
<entry valign="top">
1210
-
</entry>
1211
-
</row>
1212
-
<row>
1213
-
<entry valign="top"><constant>CURLOPT_TIMEVALUE_LARGE</constant></entry>
1214
-
<entry valign="top">
1215
-
The time in seconds since January 1st, 1970. The time will be used
1216
-
by <constant>CURLOPT_TIMECONDITION</constant>. Defaults to zero.
1217
-
The difference between this option and <constant>CURLOPT_TIMEVALUE</constant>
1218
-
is the type of the argument. On systems where 'long' is only 32 bit wide,
1219
-
this option has to be used to set dates beyond the year 2038.
1220
-
</entry>
1221
-
<entry valign="top">
1222
-
Added in cURL 7.59.0. Available since PHP 7.3.0.
1223
-
</entry>
1224
-
</row>
1225
-
<row>
1226
-
<entry valign="top"><constant>CURLOPT_MAX_RECV_SPEED_LARGE</constant></entry>
1227
-
<entry valign="top">
1228
-
If a download exceeds this speed (counted in bytes per second) on
1229
-
cumulative average during the transfer, the transfer will pause to
1230
-
keep the average rate less than or equal to the parameter value.
1231
-
Defaults to unlimited speed.
1232
-
</entry>
1233
-
<entry valign="top">
1234
-
Added in cURL 7.15.5. Available since PHP 5.4.0.
1235
-
</entry>
1236
-
</row>
1237
-
<row>
1238
-
<entry valign="top"><constant>CURLOPT_MAX_SEND_SPEED_LARGE</constant></entry>
1239
-
<entry valign="top">
1240
-
If an upload exceeds this speed (counted in bytes per second) on
1241
-
cumulative average during the transfer, the transfer will pause to
1242
-
keep the average rate less than or equal to the parameter value.
1243
-
Defaults to unlimited speed.
1244
-
</entry>
1245
-
<entry valign="top">
1246
-
Added in cURL 7.15.5. Available since PHP 5.4.0.
1247
-
</entry>
1248
-
</row>
1249
-
<row>
1250
-
<entry valign="top"><constant>CURLOPT_SSH_AUTH_TYPES</constant></entry>
1251
-
<entry valign="top">
1252
-
A bitmask consisting of one or more of
1253
-
<constant>CURLSSH_AUTH_PUBLICKEY</constant>,
1254
-
<constant>CURLSSH_AUTH_PASSWORD</constant>,
1255
-
<constant>CURLSSH_AUTH_HOST</constant>,
1256
-
<constant>CURLSSH_AUTH_KEYBOARD</constant>. Set to
1257
-
<constant>CURLSSH_AUTH_ANY</constant> to let libcurl pick one.
1258
-
</entry>
1259
-
<entry valign="top">
1260
-
Added in cURL 7.16.1.
1261
-
</entry>
1262
-
</row>
1263
-
<row>
1264
-
<entry valign="top"><constant>CURLOPT_IPRESOLVE</constant></entry>
1265
-
<entry valign="top">
1266
-
Allows an application to select what kind of IP addresses to use when
1267
-
resolving host names. This is only interesting when using host names that
1268
-
resolve addresses using more than one version of IP, possible values are
1269
-
<constant>CURL_IPRESOLVE_WHATEVER</constant>,
1270
-
<constant>CURL_IPRESOLVE_V4</constant>,
1271
-
<constant>CURL_IPRESOLVE_V6</constant>, by default
1272
-
<constant>CURL_IPRESOLVE_WHATEVER</constant>.
1273
-
</entry>
1274
-
<entry valign="top">
1275
-
Added in cURL 7.10.8.
1276
-
</entry>
1277
-
</row>
1278
-
<row>
1279
-
<entry valign="top"><constant>CURLOPT_FTP_FILEMETHOD</constant></entry>
1280
-
<entry valign="top">
1281
-
Tell curl which method to use to reach a file on a FTP(S) server. Possible values are
1282
-
<constant>CURLFTPMETHOD_MULTICWD</constant>,
1283
-
<constant>CURLFTPMETHOD_NOCWD</constant> and
1284
-
<constant>CURLFTPMETHOD_SINGLECWD</constant>.
1285
-
</entry>
1286
-
<entry valign="top">
1287
-
Added in cURL 7.15.1. Available since PHP 5.3.0.
1288
-
</entry>
1289
-
</row>
1290
-
</tbody>
1291
-
</tgroup>
1292
-
</informaltable>
1293
-
</para>
1294
-
<para>
1295
-
<parameter>value</parameter> should be a <type>string</type> for the
1296
-
following values of the <parameter>option</parameter> parameter:
1297
-
<informaltable>
1298
-
<tgroup cols="3">
1299
-
<thead>
1300
-
<row>
1301
-
<entry>Option</entry>
1302
-
<entry>Set <parameter>value</parameter> to</entry>
1303
-
<entry>Notes</entry>
1304
-
</row>
1305
-
</thead>
1306
-
<tbody>
1307
-
<row>
1308
-
<entry valign="top"><constant>CURLOPT_ABSTRACT_UNIX_SOCKET</constant></entry>
1309
-
<entry valign="top">
1310
-
Enables the use of an abstract Unix domain socket instead of
1311
-
establishing a TCP connection to a host and sets the path to
1312
-
the given <type>string</type>. This option shares the same semantics
1313
-
as <constant>CURLOPT_UNIX_SOCKET_PATH</constant>. These two options
1314
-
share the same storage and therefore only one of them can be set
1315
-
per handle.
1316
-
</entry>
1317
-
<entry valign="top">
1318
-
Available since PHP 7.3.0 and cURL 7.53.0
1319
-
</entry>
1320
-
</row>
1321
-
<row>
1322
-
<entry valign="top"><constant>CURLOPT_CAINFO</constant></entry>
1323
-
<entry valign="top">
1324
-
The name of a file holding one or more certificates to verify the
1325
-
peer with. This only makes sense when used in combination with
1326
-
<constant>CURLOPT_SSL_VERIFYPEER</constant>.
1327
-
</entry>
1328
-
<entry valign="top">
1329
-
Might require an absolute path.
1330
-
</entry>
1331
-
</row>
1332
-
<row>
1333
-
<entry valign="top"><constant>CURLOPT_CAPATH</constant></entry>
1334
-
<entry valign="top">
1335
-
A directory that holds multiple CA certificates. Use this option
1336
-
alongside <constant>CURLOPT_SSL_VERIFYPEER</constant>.
1337
-
</entry>
1338
-
<entry valign="top">
1339
-
</entry>
1340
-
</row>
1341
-
<row>
1342
-
<entry valign="top"><constant>CURLOPT_COOKIE</constant></entry>
1343
-
<entry valign="top">
1344
-
The contents of the <literal>"Cookie: "</literal> header to be
1345
-
used in the HTTP request.
1346
-
Note that multiple cookies are separated with a semicolon followed
1347
-
by a space (e.g., "<literal>fruit=apple; colour=red</literal>")
1348
-
</entry>
1349
-
<entry valign="top">
1350
-
</entry>
1351
-
</row>
1352
-
<row>
1353
-
<entry valign="top"><constant>CURLOPT_COOKIEFILE</constant></entry>
1354
-
<entry valign="top">
1355
-
The name of the file containing the cookie data. The cookie file can
1356
-
be in Netscape format, or just plain HTTP-style headers dumped into
1357
-
a file.
1358
-
If the name is an empty string, no cookies are loaded, but cookie
1359
-
handling is still enabled.
1360
-
</entry>
1361
-
<entry valign="top">
1362
-
</entry>
1363
-
</row>
1364
-
<row>
1365
-
<entry valign="top"><constant>CURLOPT_COOKIEJAR</constant></entry>
1366
-
<entry valign="top">
1367
-
The name of a file to save all internal cookies to when the handle is closed,
1368
-
e.g. after a call to curl_close.
1369
-
</entry>
1370
-
<entry valign="top">
1371
-
</entry>
1372
-
</row>
1373
-
<row>
1374
-
<entry valign="top"><constant>CURLOPT_COOKIELIST</constant></entry>
1375
-
<entry valign="top">
1376
-
A cookie string (i.e. a single line in Netscape/Mozilla format, or a regular
1377
-
HTTP-style Set-Cookie header) adds that single cookie to the internal cookie store.
1378
-
<literal>"ALL"</literal> erases all cookies held in memory.
1379
-
<literal>"SESS"</literal> erases all session cookies held in memory.
1380
-
<literal>"FLUSH"</literal> writes all known cookies to the file specified by <constant>CURLOPT_COOKIEJAR</constant>.
1381
-
<literal>"RELOAD"</literal> loads all cookies from the files specified by <constant>CURLOPT_COOKIEFILE</constant>.
1382
-
</entry>
1383
-
<entry valign="top">
1384
-
Available since PHP 5.5.0 and cURL 7.14.1.
1385
-
</entry>
1386
-
</row>
1387
-
<row>
1388
-
<entry valign="top"><constant>CURLOPT_CUSTOMREQUEST</constant></entry>
1389
-
<entry valign="top"><para>
1390
-
A custom request method to use instead of
1391
-
<literal>"GET"</literal> or <literal>"HEAD"</literal> when doing
1392
-
a HTTP request. This is useful for doing
1393
-
<literal>"DELETE"</literal> or other, more obscure HTTP requests.
1394
-
Valid values are things like <literal>"GET"</literal>,
1395
-
<literal>"POST"</literal>, <literal>"CONNECT"</literal> and so on;
1396
-
i.e. Do not enter a whole HTTP request line here. For instance,
1397
-
entering <literal>"GET /index.html HTTP/1.0\r\n\r\n"</literal>
1398
-
would be incorrect.
1399
-
<note>
1400
-
<para>
1401
-
Don't do this without making sure the server supports the custom
1402
-
request method first.
1403
-
</para>
1404
-
</note>
1405
-
</para></entry>
1406
-
<entry valign="top">
1407
-
</entry>
1408
-
</row>
1409
-
<row>
1410
-
<entry valign="top"><constant>CURLOPT_DEFAULT_PROTOCOL</constant></entry>
1411
-
<entry valign="top"><para>
1412
-
The default protocol to use if the URL is missing a scheme name.
1413
-
</para></entry>
1414
-
<entry valign="top">
1415
-
Added in cURL 7.45.0. Available since PHP 7.0.7.
1416
-
</entry>
1417
-
</row>
1418
-
<row>
1419
-
<entry valign="top"><constant>CURLOPT_DNS_INTERFACE</constant></entry>
1420
-
<entry valign="top"><para>
1421
-
Set the name of the network interface that the DNS resolver should bind to.
1422
-
This must be an interface name (not an address).
1423
-
</para></entry>
1424
-
<entry valign="top">
1425
-
Added in cURL 7.33.0. Available since PHP 7.0.7.
1426
-
</entry>
1427
-
</row>
1428
-
<row>
1429
-
<entry valign="top"><constant>CURLOPT_DNS_LOCAL_IP4</constant></entry>
1430
-
<entry valign="top"><para>
1431
-
Set the local IPv4 address that the resolver should bind to. The argument
1432
-
should contain a single numerical IPv4 address as a string.
1433
-
</para></entry>
1434
-
<entry valign="top">
1435
-
Added in cURL 7.33.0. Available since PHP 7.0.7.
1436
-
</entry>
1437
-
</row>
1438
-
<row>
1439
-
<entry valign="top"><constant>CURLOPT_DNS_LOCAL_IP6</constant></entry>
1440
-
<entry valign="top"><para>
1441
-
Set the local IPv6 address that the resolver should bind to. The argument
1442
-
should contain a single numerical IPv6 address as a string.
1443
-
</para></entry>
1444
-
<entry valign="top">
1445
-
Added in cURL 7.33.0. Available since PHP 7.0.7.
1446
-
</entry>
1447
-
</row>
1448
-
<row>
1449
-
<entry valign="top"><constant>CURLOPT_EGDSOCKET</constant></entry>
1450
-
<entry valign="top">
1451
-
Like <constant>CURLOPT_RANDOM_FILE</constant>, except a filename
1452
-
to an Entropy Gathering Daemon socket.
1453
-
</entry>
1454
-
<entry valign="top">
1455
-
</entry>
1456
-
</row>
1457
-
<row>
1458
-
<entry valign="top"><constant>CURLOPT_ENCODING</constant></entry>
1459
-
<entry valign="top">
1460
-
The contents of the <literal>"Accept-Encoding: "</literal> header.
1461
-
This enables decoding of the response. Supported encodings are
1462
-
<literal>"identity"</literal>, <literal>"deflate"</literal>, and
1463
-
<literal>"gzip"</literal>. If an empty string, <literal>""</literal>,
1464
-
is set, a header containing all supported encoding types is sent.
1465
-
</entry>
1466
-
<entry valign="top">
1467
-
Added in cURL 7.10.
1468
-
</entry>
1469
-
</row>
1470
-
<row>
1471
-
<entry valign="top"><constant>CURLOPT_FTPPORT</constant></entry>
1472
-
<entry valign="top">
1473
-
The value which will be used to get the IP address to use
1474
-
for the FTP "PORT" instruction. The "PORT" instruction tells
1475
-
the remote server to connect to our specified IP address. The
1476
-
string may be a plain IP address, a hostname, a network
1477
-
interface name (under Unix), or just a plain '-' to use the
1478
-
systems default IP address.
1479
-
</entry>
1480
-
<entry valign="top">
1481
-
</entry>
1482
-
</row>
1483
-
<row>
1484
-
<entry valign="top"><constant>CURLOPT_INTERFACE</constant></entry>
1485
-
<entry valign="top">
1486
-
The name of the outgoing network interface to use. This can be an
1487
-
interface name, an IP address or a host name.
1488
-
</entry>
1489
-
<entry valign="top">
1490
-
</entry>
1491
-
</row>
1492
-
<row>
1493
-
<entry valign="top"><constant>CURLOPT_KEYPASSWD</constant></entry>
1494
-
<entry valign="top">
1495
-
The password required to use the <constant>CURLOPT_SSLKEY</constant>
1496
-
or <constant>CURLOPT_SSH_PRIVATE_KEYFILE</constant> private key.
1497
-
</entry>
1498
-
<entry valign="top">
1499
-
Added in cURL 7.16.1.
1500
-
</entry>
1501
-
</row>
1502
-
<row>
1503
-
<entry valign="top"><constant>CURLOPT_KRB4LEVEL</constant></entry>
1504
-
<entry valign="top">
1505
-
The KRB4 (Kerberos 4) security level. Any of the following values
1506
-
(in order from least to most powerful) are valid:
1507
-
<literal>"clear"</literal>,
1508
-
<literal>"safe"</literal>,
1509
-
<literal>"confidential"</literal>,
1510
-
<literal>"private".</literal>.
1511
-
If the string does not match one of these,
1512
-
<literal>"private"</literal> is used. Setting this option to &null;
1513
-
will disable KRB4 security. Currently KRB4 security only works
1514
-
with FTP transactions.
1515
-
</entry>
1516
-
<entry valign="top">
1517
-
</entry>
1518
-
</row>
1519
-
<row>
1520
-
<entry valign="top"><constant>CURLOPT_LOGIN_OPTIONS</constant></entry>
1521
-
<entry valign="top">
1522
-
Can be used to set protocol specific login options, such as the
1523
-
preferred authentication mechanism via "AUTH=NTLM" or "AUTH=*",
1524
-
and should be used in conjunction with the
1525
-
<constant>CURLOPT_USERNAME</constant> option.
1526
-
</entry>
1527
-
<entry valign="top">
1528
-
Added in cURL 7.34.0. Available since PHP 7.0.7.
1529
-
</entry>
1530
-
</row>
1531
-
<row>
1532
-
<entry valign="top"><constant>CURLOPT_PINNEDPUBLICKEY</constant></entry>
1533
-
<entry valign="top">
1534
-
Set the pinned public key.
1535
-
The string can be the file name of your pinned public key. The file
1536
-
format expected is "PEM" or "DER". The string can also be any
1537
-
number of base64 encoded sha256 hashes preceded by "sha256//" and
1538
-
separated by ";".
1539
-
</entry>
1540
-
<entry valign="top">
1541
-
Added in cURL 7.39.0. Available since PHP 7.0.7.
1542
-
</entry>
1543
-
</row>
1544
-
<row>
1545
-
<entry valign="top"><constant>CURLOPT_POSTFIELDS</constant></entry>
1546
-
<entry valign="top">
1547
-
<simpara>
1548
-
The full data to post in a HTTP "POST" operation.
1549
-
To post a file, prepend a filename with <literal>@</literal> and
1550
-
use the full path. The filetype can be explicitly specified by
1551
-
following the filename with the type in the format
1552
-
'<literal>;type=mimetype</literal>'. This parameter can either be
1553
-
passed as a urlencoded string like '<literal>para1=val1&amp;para2=val2&amp;...</literal>'
1554
-
or as an array with the field name as key and field data as value.
1555
-
If <parameter>value</parameter> is an array, the
1556
-
<literal>Content-Type</literal> header will be set to
1557
-
<literal>multipart/form-data</literal>.
1558
-
</simpara>
1559
-
<simpara>
1560
-
As of PHP 5.2.0, <parameter>value</parameter> must be an array if
1561
-
files are passed to this option with the <literal>@</literal> prefix.
1562
-
</simpara>
1563
-
<simpara>
1564
-
As of PHP 5.5.0, the <literal>@</literal> prefix is deprecated and
1565
-
files can be sent using <classname>CURLFile</classname>. The
1566
-
<literal>@</literal> prefix can be disabled for safe passing of
1567
-
values beginning with <literal>@</literal> by setting the
1568
-
<constant>CURLOPT_SAFE_UPLOAD</constant> option to &true;.
1569
-
</simpara>
1570
-
</entry>
1571
-
<entry valign="top">
1572
-
</entry>
1573
-
</row>
1574
-
<row>
1575
-
<entry valign="top"><constant>CURLOPT_PRIVATE</constant></entry>
1576
-
<entry valign="top">
1577
-
Any data that should be associated with this cURL handle. This data
1578
-
can subsequently be retrieved with the
1579
-
<constant>CURLINFO_PRIVATE</constant> option of
1580
-
<function>curl_getinfo</function>. cURL does nothing with this data.
1581
-
When using a cURL multi handle, this private data is typically a
1582
-
unique key to identify a standard cURL handle.
1583
-
</entry>
1584
-
<entry valign="top">
1585
-
Added in cURL 7.10.3.
1586
-
</entry>
1587
-
</row>
1588
-
<row>
1589
-
<entry valign="top"><constant>CURLOPT_PRE_PROXY</constant></entry>
1590
-
<entry valign="top">
1591
-
Set a <type>string</type> holding the host name or dotted numerical
1592
-
IP address to be used as the preproxy that curl connects to before
1593
-
it connects to the HTTP(S) proxy specified in the
1594
-
<constant>CURLOPT_PROXY</constant> option for the upcoming request.
1595
-
The preproxy can only be a SOCKS proxy and it should be prefixed with
1596
-
<literal>[scheme]://</literal> to specify which kind of socks is used.
1597
-
A numerical IPv6 address must be written within [brackets].
1598
-
Setting the preproxy to an empty string explicitly disables the use of a preproxy.
1599
-
To specify port number in this string, append <literal>:[port]</literal>
1600
-
to the end of the host name. The proxy's port number may optionally be
1601
-
specified with the separate option <constant>CURLOPT_PROXYPORT</constant>.
1602
-
Defaults to using port 1080 for proxies if a port is not specified.
1603
-
</entry>
1604
-
<entry valign="top">
1605
-
Available since PHP 7.3.0 and libcurl >= cURL 7.52.0.
1606
-
</entry>
1607
-
</row>
1608
-
<row>
1609
-
<entry valign="top"><constant>CURLOPT_PROXY</constant></entry>
1610
-
<entry valign="top">
1611
-
The HTTP proxy to tunnel requests through.
1612
-
</entry>
1613
-
<entry valign="top">
1614
-
</entry>
1615
-
</row>
1616
-
<row>
1617
-
<entry valign="top"><constant>CURLOPT_PROXY_SERVICE_NAME</constant></entry>
1618
-
<entry valign="top">
1619
-
The proxy authentication service name.
1620
-
</entry>
1621
-
<entry valign="top">
1622
-
Added in cURL 7.34.0. Available since PHP 7.0.7.
1623
-
</entry>
1624
-
</row>
1625
-
<row>
1626
-
<entry valign="top"><constant>CURLOPT_PROXY_CAINFO</constant></entry>
1627
-
<entry valign="top">
1628
-
The path to proxy Certificate Authority (CA) bundle. Set the path as a
1629
-
<type>string</type> naming a file holding one or more certificates to
1630
-
verify the HTTPS proxy with.
1631
-
This option is for connecting to an HTTPS proxy, not an HTTPS server.
1632
-
Defaults set to the system path where libcurl's cacert bundle is assumed
1633
-
to be stored.
1634
-
</entry>
1635
-
<entry valign="top">
1636
-
Available since PHP 7.3.0 and libcurl >= cURL 7.52.0.
1637
-
</entry>
1638
-
</row>
1639
-
<row>
1640
-
<entry valign="top"><constant>CURLOPT_PROXY_CAPATH</constant></entry>
1641
-
<entry valign="top">
1642
-
The directory holding multiple CA certificates to verify the HTTPS proxy with.
1643
-
</entry>
1644
-
<entry valign="top">
1645
-
Available since PHP 7.3.0 and libcurl >= cURL 7.52.0.
1646
-
</entry>
1647
-
</row>
1648
-
<row>
1649
-
<entry valign="top"><constant>CURLOPT_PROXY_CRLFILE</constant></entry>
1650
-
<entry valign="top">
1651
-
Set the file name with the concatenation of CRL (Certificate Revocation List)
1652
-
in PEM format to use in the certificate validation that occurs during
1653
-
the SSL exchange.
1654
-
</entry>
1655
-
<entry valign="top">
1656
-
Available since PHP 7.3.0 and libcurl >= cURL 7.52.0.
1657
-
</entry>
1658
-
</row>
1659
-
<row>
1660
-
<entry valign="top"><constant>CURLOPT_PROXY_KEYPASSWD</constant></entry>
1661
-
<entry valign="top">
1662
-
Set the string be used as the password required to use the
1663
-
<constant>CURLOPT_PROXY_SSLKEY</constant> private key. You never needed a
1664
-
passphrase to load a certificate but you need one to load your private key.
1665
-
This option is for connecting to an HTTPS proxy, not an HTTPS server.
1666
-
</entry>
1667
-
<entry valign="top">
1668
-
Available since PHP 7.3.0 and libcurl >= cURL 7.52.0.
1669
-
</entry>
1670
-
</row>
1671
-
<row>
1672
-
<entry valign="top"><constant>CURLOPT_PROXY_PINNEDPUBLICKEY</constant></entry>
1673
-
<entry valign="top">
1674
-
Set the pinned public key for HTTPS proxy. The string can be the file name
1675
-
of your pinned public key. The file format expected is "PEM" or "DER".
1676
-
The string can also be any number of base64 encoded sha256 hashes preceded by
1677
-
"sha256//" and separated by ";"
1678
-
</entry>
1679
-
<entry valign="top">
1680
-
Available since PHP 7.3.0 and libcurl >= cURL 7.52.0.
1681
-
</entry>
1682
-
</row>
1683
-
<row>
1684
-
<entry valign="top"><constant>CURLOPT_PROXY_SSLCERT</constant></entry>
1685
-
<entry valign="top">
1686
-
The file name of your client certificate used to connect to the HTTPS proxy.
1687
-
The default format is "P12" on Secure Transport and "PEM" on other engines,
1688
-
and can be changed with <constant>CURLOPT_PROXY_SSLCERTTYPE</constant>.
1689
-
With NSS or Secure Transport, this can also be the nickname of the certificate
1690
-
you wish to authenticate with as it is named in the security database.
1691
-
If you want to use a file from the current directory, please precede it with
1692
-
"./" prefix, in order to avoid confusion with a nickname.
1693
-
</entry>
1694
-
<entry valign="top">
1695
-
Available since PHP 7.3.0 and libcurl >= cURL 7.52.0.
1696
-
</entry>
1697
-
</row>
1698
-
<row>
1699
-
<entry valign="top"><constant>CURLOPT_PROXY_SSLCERTTYPE</constant></entry>
1700
-
<entry valign="top">
1701
-
The format of your client certificate used when connecting to an HTTPS proxy.
1702
-
Supported formats are "PEM" and "DER", except with Secure Transport.
1703
-
OpenSSL (versions 0.9.3 and later) and Secure Transport
1704
-
(on iOS 5 or later, or OS X 10.7 or later) also support "P12" for
1705
-
PKCS#12-encoded files. Defaults to "PEM".
1706
-
</entry>
1707
-
<entry valign="top">
1708
-
Available since PHP 7.3.0 and libcurl >= cURL 7.52.0.
1709
-
</entry>
1710
-
</row>
1711
-
<row>
1712
-
<entry valign="top"><constant>CURLOPT_PROXY_SSL_CIPHER_LIST</constant></entry>
1713
-
<entry valign="top">
1714
-
The list of ciphers to use for the connection to the HTTPS proxy.
1715
-
The list must be syntactically correct, it consists of one or more cipher
1716
-
strings separated by colons. Commas or spaces are also acceptable separators
1717
-
but colons are normally used, !, - and + can be used as operators.
1718
-
</entry>
1719
-
<entry valign="top">
1720
-
Available since PHP 7.3.0 and libcurl >= cURL 7.52.0.
1721
-
</entry>
1722
-
</row>
1723
-
<row>
1724
-
<entry valign="top"><constant>CURLOPT_PROXY_TLS13_CIPHERS</constant></entry>
1725
-
<entry valign="top">
1726
-
The list of cipher suites to use for the TLS 1.3 connection to a proxy.
1727
-
The list must be syntactically correct, it consists of one or more
1728
-
cipher suite strings separated by colons. This option is currently used
1729
-
only when curl is built to use OpenSSL 1.1.1 or later.
1730
-
If you are using a different SSL backend you can try setting
1731
-
TLS 1.3 cipher suites by using the <constant>CURLOPT_PROXY_SSL_CIPHER_LIST</constant> option.
1732
-
</entry>
1733
-
<entry valign="top">
1734
-
Available since PHP 7.3.0 and libcurl >= cURL 7.61.0. Available when built with OpenSSL >= 1.1.1.
1735
-
</entry>
1736
-
</row>
1737
-
<row>
1738
-
<entry valign="top"><constant>CURLOPT_PROXY_SSLKEY</constant></entry>
1739
-
<entry valign="top">
1740
-
The file name of your private key used for connecting to the HTTPS proxy.
1741
-
The default format is "PEM" and can be changed with
1742
-
<constant>CURLOPT_PROXY_SSLKEYTYPE</constant>.
1743
-
(iOS and Mac OS X only) This option is ignored if curl was built against Secure Transport.
1744
-
</entry>
1745
-
<entry valign="top">
1746
-
Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. Available if built TLS enabled.
1747
-
</entry>
1748
-
</row>
1749
-
<row>
1750
-
<entry valign="top"><constant>CURLOPT_PROXY_SSLKEYTYPE</constant></entry>
1751
-
<entry valign="top">
1752
-
The format of your private key. Supported formats are "PEM", "DER" and "ENG".
1753
-
</entry>
1754
-
<entry valign="top">
1755
-
Available since PHP 7.3.0 and libcurl >= cURL 7.52.0.
1756
-
</entry>
1757
-
</row>
1758
-
<row>
1759
-
<entry valign="top"><constant>CURLOPT_PROXY_TLSAUTH_PASSWORD</constant></entry>
1760
-
<entry valign="top">
1761
-
The password to use for the TLS authentication method specified with the
1762
-
<constant>CURLOPT_PROXY_TLSAUTH_TYPE</constant> option. Requires that the
1763
-
<constant>CURLOPT_PROXY_TLSAUTH_USERNAME</constant> option to also be set.
1764
-
</entry>
1765
-
<entry valign="top">
1766
-
Available since PHP 7.3.0 and libcurl >= cURL 7.52.0.
1767
-
</entry>
1768
-
</row>
1769
-
<row>
1770
-
<entry valign="top"><constant>CURLOPT_PROXY_TLSAUTH_TYPE</constant></entry>
1771
-
<entry valign="top">
1772
-
The method of the TLS authentication used for the HTTPS connection. Supported method is "SRP".
1773
-
<note>
1774
-
<para>
1775
-
Secure Remote Password (SRP) authentication for TLS provides mutual authentication
1776
-
if both sides have a shared secret. To use TLS-SRP, you must also set the
1777
-
<constant>CURLOPT_PROXY_TLSAUTH_USERNAME</constant> and
1778
-
<constant>CURLOPT_PROXY_TLSAUTH_PASSWORD</constant> options.
1779
-
</para>
1780
-
</note>
1781
-
</entry>
1782
-
<entry valign="top">
1783
-
Available since PHP 7.3.0 and libcurl >= cURL 7.52.0.
1784
-
</entry>
1785
-
</row>
1786
-
<row>
1787
-
<entry valign="top"><constant>CURLOPT_PROXY_TLSAUTH_USERNAME</constant></entry>
1788
-
<entry valign="top">
1789
-
Tusername to use for the HTTPS proxy TLS authentication method specified with the
1790
-
<constant>CURLOPT_PROXY_TLSAUTH_TYPE</constant> option. Requires that the
1791
-
<constant>CURLOPT_PROXY_TLSAUTH_PASSWORD</constant> option to also be set.
1792
-
</entry>
1793
-
<entry valign="top">
1794
-
Available since PHP 7.3.0 and libcurl >= cURL 7.52.0.
1795
-
</entry>
1796
-
</row>
1797
-
<row>
1798
-
<entry valign="top"><constant>CURLOPT_PROXYUSERPWD</constant></entry>
1799
-
<entry valign="top">
1800
-
A username and password formatted as
1801
-
<literal>"[username]:[password]"</literal> to use for the
1802
-
connection to the proxy.
1803
-
</entry>
1804
-
<entry valign="top">
1805
-
</entry>
1806
-
</row>
1807
-
<row>
1808
-
<entry valign="top"><constant>CURLOPT_RANDOM_FILE</constant></entry>
1809
-
<entry valign="top">
1810
-
A filename to be used to seed the random number generator for SSL.
1811
-
</entry>
1812
-
<entry valign="top">
1813
-
</entry>
1814
-
</row>
1815
-
<row>
1816
-
<entry valign="top"><constant>CURLOPT_RANGE</constant></entry>
1817
-
<entry valign="top">
1818
-
Range(s) of data to retrieve in the format
1819
-
<literal>"X-Y"</literal> where X or Y are optional. HTTP transfers
1820
-
also support several intervals, separated with commas in the format
1821
-
<literal>"X-Y,N-M"</literal>.
1822
-
</entry>
1823
-
<entry valign="top">
1824
-
</entry>
1825
-
</row>
1826
-
<row>
1827
-
<entry valign="top"><constant>CURLOPT_REFERER</constant></entry>
1828
-
<entry valign="top">
1829
-
The contents of the <literal>"Referer: "</literal> header to be used
1830
-
in a HTTP request.
1831
-
</entry>
1832
-
<entry valign="top">
1833
-
</entry>
1834
-
</row>
1835
-
<row>
1836
-
<entry valign="top"><constant>CURLOPT_SERVICE_NAME</constant></entry>
1837
-
<entry valign="top">
1838
-
The authentication service name.
1839
-
</entry>
1840
-
<entry valign="top">
1841
-
Added in cURL 7.43.0. Available since PHP 7.0.7.
1842
-
</entry>
1843
-
</row>
1844
-
<row>
1845
-
<entry valign="top"><constant>CURLOPT_SSH_HOST_PUBLIC_KEY_MD5</constant></entry>
1846
-
<entry valign="top">
1847
-
A string containing 32 hexadecimal digits. The string should be the
1848
-
MD5 checksum of the remote host's public key, and libcurl will reject
1849
-
the connection to the host unless the md5sums match.
1850
-
This option is only for SCP and SFTP transfers.
1851
-
</entry>
1852
-
<entry valign="top">
1853
-
Added in cURL 7.17.1.
1854
-
</entry>
1855
-
</row>
1856
-
<row>
1857
-
<entry valign="top"><constant>CURLOPT_SSH_PUBLIC_KEYFILE</constant></entry>
1858
-
<entry valign="top">
1859
-
The file name for your public key. If not used, libcurl defaults to
1860
-
$HOME/.ssh/id_dsa.pub if the HOME environment variable is set,
1861
-
and just "id_dsa.pub" in the current directory if HOME is not set.
1862
-
</entry>
1863
-
<entry valign="top">
1864
-
Added in cURL 7.16.1.
1865
-
</entry>
1866
-
</row>
1867
-
<row>
1868
-
<entry valign="top"><constant>CURLOPT_SSH_PRIVATE_KEYFILE</constant></entry>
1869
-
<entry valign="top">
1870
-
The file name for your private key. If not used, libcurl defaults to
1871
-
$HOME/.ssh/id_dsa if the HOME environment variable is set,
1872
-
and just "id_dsa" in the current directory if HOME is not set.
1873
-
If the file is password-protected, set the password with
1874
-
<constant>CURLOPT_KEYPASSWD</constant>.
1875
-
</entry>
1876
-
<entry valign="top">
1877
-
Added in cURL 7.16.1.
1878
-
</entry>
1879
-
</row>
1880
-
<row>
1881
-
<entry valign="top"><constant>CURLOPT_SSL_CIPHER_LIST</constant></entry>
1882
-
<entry valign="top">
1883
-
A list of ciphers to use for SSL. For example,
1884
-
<literal>RC4-SHA</literal> and <literal>TLSv1</literal> are valid
1885
-
cipher lists.
1886
-
</entry>
1887
-
<entry valign="top">
1888
-
</entry>
1889
-
</row>
1890
-
<row>
1891
-
<entry valign="top"><constant>CURLOPT_SSLCERT</constant></entry>
1892
-
<entry valign="top">
1893
-
The name of a file containing a PEM formatted certificate.
1894
-
</entry>
1895
-
<entry valign="top">
1896
-
</entry>
1897
-
</row>
1898
-
<row>
1899
-
<entry valign="top"><constant>CURLOPT_SSLCERTPASSWD</constant></entry>
1900
-
<entry valign="top">
1901
-
The password required to use the
1902
-
<constant>CURLOPT_SSLCERT</constant> certificate.
1903
-
</entry>
1904
-
<entry valign="top">
1905
-
</entry>
1906
-
</row>
1907
-
<row>
1908
-
<entry valign="top"><constant>CURLOPT_SSLCERTTYPE</constant></entry>
1909
-
<entry valign="top">
1910
-
The format of the certificate. Supported formats are
1911
-
<literal>"PEM"</literal> (default), <literal>"DER"</literal>,
1912
-
and <literal>"ENG"</literal>.
1913
-
As of OpenSSL 0.9.3, <literal>"P12"</literal> (for PKCS#12-encoded files)
1914
-
is also supported.
1915
-
</entry>
1916
-
<entry valign="top">
1917
-
Added in cURL 7.9.3.
1918
-
</entry>
1919
-
</row>
1920
-
<row>
1921
-
<entry valign="top"><constant>CURLOPT_SSLENGINE</constant></entry>
1922
-
<entry valign="top">
1923
-
The identifier for the crypto engine of the private SSL key
1924
-
specified in <constant>CURLOPT_SSLKEY</constant>.
1925
-
</entry>
1926
-
<entry valign="top">
1927
-
</entry>
1928
-
</row>
1929
-
<row>
1930
-
<entry valign="top"><constant>CURLOPT_SSLENGINE_DEFAULT</constant></entry>
1931
-
<entry valign="top">
1932
-
The identifier for the crypto engine used for asymmetric crypto
1933
-
operations.
1934
-
</entry>
1935
-
<entry valign="top">
1936
-
</entry>
1937
-
</row>
1938
-
<row>
1939
-
<entry valign="top"><constant>CURLOPT_SSLKEY</constant></entry>
1940
-
<entry valign="top">
1941
-
The name of a file containing a private SSL key.
1942
-
</entry>
1943
-
<entry valign="top">
1944
-
</entry>
1945
-
</row>
1946
-
<row>
1947
-
<entry valign="top"><constant>CURLOPT_SSLKEYPASSWD</constant></entry>
1948
-
<entry valign="top"><para>
1949
-
The secret password needed to use the private SSL key specified in
1950
-
<constant>CURLOPT_SSLKEY</constant>.
1951
-
<note>
1952
-
<para>
1953
-
Since this option contains a sensitive password, remember to keep
1954
-
the PHP script it is contained within safe.
1955
-
</para>
1956
-
</note>
1957
-
</para></entry>
1958
-
<entry valign="top">
1959
-
</entry>
1960
-
</row>
1961
-
<row>
1962
-
<entry valign="top"><constant>CURLOPT_SSLKEYTYPE</constant></entry>
1963
-
<entry valign="top">
1964
-
The key type of the private SSL key specified in
1965
-
<constant>CURLOPT_SSLKEY</constant>. Supported key types are
1966
-
<literal>"PEM"</literal> (default), <literal>"DER"</literal>,
1967
-
and <literal>"ENG"</literal>.
1968
-
</entry>
1969
-
<entry valign="top">
1970
-
</entry>
1971
-
</row>
1972
-
<row>
1973
-
<entry valign="top"><constant>CURLOPT_TLS13_CIPHERS</constant></entry>
1974
-
<entry valign="top">
1975
-
The list of cipher suites to use for the TLS 1.3 connection. The list must be
1976
-
syntactically correct, it consists of one or more cipher suite strings separated by colons.
1977
-
This option is currently used only when curl is built to use OpenSSL 1.1.1 or later.
1978
-
If you are using a different SSL backend you can try setting
1979
-
TLS 1.3 cipher suites by using the <constant>CURLOPT_SSL_CIPHER_LIST</constant> option.
1980
-
</entry>
1981
-
<entry valign="top">
1982
-
Available since PHP 7.3.0 and libcurl >= cURL 7.61.0. Available when built with OpenSSL >= 1.1.1.
1983
-
</entry>
1984
-
</row>
1985
-
<row>
1986
-
<entry valign="top"><constant>CURLOPT_UNIX_SOCKET_PATH</constant></entry>
1987
-
<entry valign="top">
1988
-
Enables the use of Unix domain sockets as connection endpoint and
1989
-
sets the path to the given <type>string</type>.
1990
-
</entry>
1991
-
<entry valign="top">
1992
-
Added in cURL 7.40.0. Available since PHP 7.0.7.
1993
-
</entry>
1994
-
</row>
1995
-
<row>
1996
-
<entry valign="top"><constant>CURLOPT_URL</constant></entry>
1997
-
<entry valign="top">
1998
-
The URL to fetch. This can also be set when initializing a
1999
-
session with <function>curl_init</function>.
2000
-
</entry>
2001
-
<entry valign="top">
2002
-
</entry>
2003
-
</row>
2004
-
<row>
2005
-
<entry valign="top"><constant>CURLOPT_USERAGENT</constant></entry>
2006
-
<entry valign="top">
2007
-
The contents of the <literal>"User-Agent: "</literal> header to be
2008
-
used in a HTTP request.
2009
-
</entry>
2010
-
<entry valign="top">
2011
-
</entry>
2012
-
</row>
2013
-
<row>
2014
-
<entry valign="top"><constant>CURLOPT_USERNAME</constant></entry>
2015
-
<entry valign="top">
2016
-
The user name to use in authentication.
2017
-
</entry>
2018
-
<entry valign="top">
2019
-
Added in cURL 7.19.1. Available since PHP 5.5.0.
2020
-
</entry>
2021
-
</row>
2022
-
<row>
2023
-
<entry valign="top"><constant>CURLOPT_USERPWD</constant></entry>
2024
-
<entry valign="top">
2025
-
A username and password formatted as
2026
-
<literal>"[username]:[password]"</literal> to use for the
2027
-
connection.
2028
-
</entry>
2029
-
<entry valign="top">
2030
-
</entry>
2031
-
</row>
2032
-
<row>
2033
-
<entry valign="top"><constant>CURLOPT_XOAUTH2_BEARER</constant></entry>
2034
-
<entry valign="top">
2035
-
Specifies the OAuth 2.0 access token.
2036
-
</entry>
2037
-
<entry valign="top">
2038
-
Added in cURL 7.33.0. Available since PHP 7.0.7.
2039
-
</entry>
2040
-
</row>
2041
-
</tbody>
2042
-
</tgroup>
2043
-
</informaltable>
2044
-
</para>
2045
-
<para>
2046
-
<parameter>value</parameter> should be an array for the
2047
-
following values of the <parameter>option</parameter> parameter:
2048
-
<informaltable>
2049
-
<tgroup cols="3">
2050
-
<thead>
2051
-
<row>
2052
-
<entry>Option</entry>
2053
-
<entry>Set <parameter>value</parameter> to</entry>
2054
-
<entry>Notes</entry>
2055
-
</row>
2056
-
</thead>
2057
-
<tbody>
2058
-
<row>
2059
-
<entry valign="top"><constant>CURLOPT_CONNECT_TO</constant></entry>
2060
-
<entry valign="top">
2061
-
Connect to a specific host and port instead of the URL's host and port.
2062
-
Accepts an array of strings with the format
2063
-
<literal>HOST:PORT:CONNECT-TO-HOST:CONNECT-TO-PORT</literal>.
2064
-
</entry>
2065
-
<entry valign="top">
2066
-
Added in cURL 7.49.0. Available since PHP 7.0.7.
2067
-
</entry>
2068
-
</row>
2069
-
<row>
2070
-
<entry valign="top"><constant>CURLOPT_HTTP200ALIASES</constant></entry>
2071
-
<entry valign="top">
2072
-
An array of HTTP 200 responses that will be treated as valid
2073
-
responses and not as errors.
2074
-
</entry>
2075
-
<entry valign="top">
2076
-
Added in cURL 7.10.3.
2077
-
</entry>
2078
-
</row>
2079
-
<row>
2080
-
<entry valign="top"><constant>CURLOPT_HTTPHEADER</constant></entry>
2081
-
<entry valign="top">
2082
-
An array of HTTP header fields to set, in the format
2083
-
<code>
2084
-
array('Content-type: text/plain', 'Content-length: 100')
2085
-
</code>
2086
-
</entry>
2087
-
<entry valign="top">
2088
-
</entry>
2089
-
</row>
2090
-
<row>
2091
-
<entry valign="top"><constant>CURLOPT_POSTQUOTE</constant></entry>
2092
-
<entry valign="top">
2093
-
An array of FTP commands to execute on the server after the FTP
2094
-
request has been performed.
2095
-
</entry>
2096
-
<entry valign="top">
2097
-
</entry>
2098
-
</row>
2099
-
<row>
2100
-
<entry valign="top"><constant>CURLOPT_PROXYHEADER</constant></entry>
2101
-
<entry valign="top">
2102
-
An array of custom HTTP headers to pass to proxies.
2103
-
</entry>
2104
-
<entry valign="top">
2105
-
Added in cURL 7.37.0. Available since PHP 7.0.7.
2106
-
</entry>
2107
-
</row>
2108
-
<row>
2109
-
<entry valign="top"><constant>CURLOPT_QUOTE</constant></entry>
2110
-
<entry valign="top">
2111
-
An array of FTP commands to execute on the server prior to the FTP
2112
-
request.
2113
-
</entry>
2114
-
<entry valign="top">
2115
-
</entry>
2116
-
</row>
2117
-
<row>
2118
-
<entry valign="top"><constant>CURLOPT_RESOLVE</constant></entry>
2119
-
<entry valign="top">
2120
-
Provide a custom address for a specific host and port pair. An array
2121
-
of hostname, port, and IP address strings, each element separated by
2122
-
a colon. In the format:
2123
-
<code>
2124
-
array("example.com:80:127.0.0.1")
2125
-
</code>
2126
-
</entry>
2127
-
<entry valign="top">
2128
-
Added in cURL 7.21.3. Available since PHP 5.5.0.
2129
-
</entry>
2130
-
</row>
2131
-
</tbody>
2132
-
</tgroup>
2133
-
</informaltable>
2134
-
</para>
2135
-
<para>
2136
-
<parameter>value</parameter> should be a stream resource (using
2137
-
<function>fopen</function>, for example) for the following values of the
2138
-
<parameter>option</parameter> parameter:
2139
-
<informaltable>
2140
-
<tgroup cols="3">
2141
-
<thead>
2142
-
<row>
2143
-
<entry>Option</entry>
2144
-
<entry>Set <parameter>value</parameter> to</entry>
2145
-
</row>
2146
-
</thead>
2147
-
<tbody>
2148
-
<row>
2149
-
<entry valign="top"><constant>CURLOPT_FILE</constant></entry>
2150
-
<entry valign="top">
2151
-
The file that the transfer should be written to. The default
2152
-
is <literal>STDOUT</literal> (the browser window).
2153
-
</entry>
2154
-
</row>
2155
-
<row>
2156
-
<entry valign="top"><constant>CURLOPT_INFILE</constant></entry>
2157
-
<entry valign="top">
2158
-
The file that the transfer should be read from when uploading.
2159
-
</entry>
2160
-
</row>
2161
-
<row>
2162
-
<entry valign="top"><constant>CURLOPT_STDERR</constant></entry>
2163
-
<entry valign="top">
2164
-
An alternative location to output errors to instead of
2165
-
<literal>STDERR</literal>.
2166
-
</entry>
2167
-
</row>
2168
-
<row>
2169
-
<entry valign="top"><constant>CURLOPT_WRITEHEADER</constant></entry>
2170
-
<entry valign="top">
2171
-
The file that the header part of the transfer is written to.
2172
-
</entry>
2173
-
</row>
2174
-
</tbody>
2175
-
</tgroup>
2176
-
</informaltable>
2177
-
</para>
2178
-
<para>
2179
-
<parameter>value</parameter> should be the name of a valid function or a Closure
2180
-
for the following values of the <parameter>option</parameter> parameter:
2181
-
<informaltable>
2182
-
<tgroup cols="3">
2183
-
<thead>
2184
-
<row>
2185
-
<entry>Option</entry>
2186
-
<entry>Set <parameter>value</parameter> to</entry>
2187
-
</row>
2188
-
</thead>
2189
-
<tbody>
2190
-
<row>
2191
-
<entry valign="top"><constant>CURLOPT_HEADERFUNCTION</constant></entry>
2192
-
<entry valign="top">
2193
-
A callback accepting two parameters.
2194
-
The first is the cURL resource, the second is a
2195
-
string with the header data to be written. The header data must
2196
-
be written by this callback. Return the number of
2197
-
bytes written.
2198
-
</entry>
2199
-
</row>
2200
-
<row>
2201
-
<entry valign="top"><constant>CURLOPT_PASSWDFUNCTION</constant></entry>
2202
-
<entry valign="top">
2203
-
A callback accepting three parameters.
2204
-
The first is the cURL resource, the second is a
2205
-
string containing a password prompt, and the third is the maximum
2206
-
password length. Return the string containing the password.
2207
-
</entry>
2208
-
</row>
2209
-
<row>
2210
-
<entry valign="top"><constant>CURLOPT_PROGRESSFUNCTION</constant></entry>
2211
-
<entry valign="top">
2212
-
<para>
2213
-
A callback accepting five parameters.
2214
-
The first is the cURL resource, the second is the total number of
2215
-
bytes expected to be downloaded in this transfer, the third is
2216
-
the number of bytes downloaded so far, the fourth is the total
2217
-
number of bytes expected to be uploaded in this transfer, and the
2218
-
fifth is the number of bytes uploaded so far.
2219
-
</para>
2220
-
<note>
2221
-
<para>
2222
-
The callback is only called when the <constant>CURLOPT_NOPROGRESS</constant>
2223
-
option is set to &false;.
2224
-
</para>
2225
-
</note>
2226
-
<para>
2227
-
Return a non-zero value to abort the transfer. In which case, the
2228
-
transfer will set a <constant>CURLE_ABORTED_BY_CALLBACK</constant>
2229
-
error.
2230
-
</para>
2231
-
</entry>
2232
-
</row>
2233
-
<row>
2234
-
<entry valign="top"><constant>CURLOPT_READFUNCTION</constant></entry>
2235
-
<entry valign="top">
2236
-
A callback accepting three parameters.
2237
-
The first is the cURL resource, the second is a
2238
-
stream resource provided to cURL through the option
2239
-
<constant>CURLOPT_INFILE</constant>, and the third is the maximum
2240
-
amount of data to be read. The callback must return a string
2241
-
with a length equal or smaller than the amount of data requested,
2242
-
typically by reading it from the passed stream resource. It should
2243
-
return an empty string to signal <literal>EOF</literal>.
2244
-
</entry>
2245
-
</row>
2246
-
<row>
2247
-
<entry valign="top"><constant>CURLOPT_WRITEFUNCTION</constant></entry>
2248
-
<entry valign="top">
2249
-
A callback accepting two parameters.
2250
-
The first is the cURL resource, and the second is a
2251
-
string with the data to be written. The data must be saved by
2252
-
this callback. It must return the exact number of bytes written
2253
-
or the transfer will be aborted with an error.
2254
-
</entry>
2255
-
</row>
2256
-
</tbody>
2257
-
</tgroup>
2258
-
</informaltable>
2259
-
</para>
2260
-
<para>
2261
-
Other values:
2262
-
<informaltable>
2263
-
<tgroup cols="3">
2264
-
<thead>
2265
-
<row>
2266
-
<entry>Option</entry>
2267
-
<entry>Set <parameter>value</parameter> to</entry>
2268
-
</row>
2269
-
</thead>
2270
-
<tbody>
2271
-
<row>
2272
-
<entry valign="top"><constant>CURLOPT_SHARE</constant></entry>
2273
-
<entry valign="top">
2274
-
A result of <function>curl_share_init</function>. Makes the cURL
2275
-
handle to use the data from the shared handle.
2276
-
</entry>
2277
-
</row>
2278
-
</tbody>
2279
-
</tgroup>
2280
-
</informaltable>
40
+
See the description of the
41
+
<constant>CURLOPT_<replaceable>*</replaceable></constant> constants
42
+
for details on the type of values each constant expects.
2281
43
</para>
2282
44
</listitem>
2283
45
</varlistentry>
...
...
@@ -2304,10 +66,18 @@
2304
66
</row>
2305
67
</thead>
2306
68
<tbody>
69
+
<row>
70
+
<entry>8.4.0</entry>
71
+
<entry>
72
+
<constant>CURLOPT_DNS_USE_GLOBAL_CACHE</constant> no longer has any effect,
73
+
and enabling it on thread-safe PHP builds no longer triggers a warning.
74
+
</entry>
75
+
</row>
76
+
&curl.changelog.handle-param;
2307
77
<row>
2308
78
<entry>7.3.15, 7.4.3</entry>
2309
79
<entry>
2310
-
Introduced <constant>CURLOPT_HTTP09_ALLOWED </constant>.
80
+
Introduced <constant>CURLOPT_HTTP09_ALLOWED</constant>.
2311
81
</entry>
2312
82
</row>
2313
83
<row>
...
...
@@ -2392,55 +162,6 @@ curl_close($ch);
2392
162
</programlisting>
2393
163
</example>
2394
164
</para>
2395
-
<para>
2396
-
<example>
2397
-
<title>Uploading file (deprecated as of PHP 5.5.0)</title>
2398
-
<programlisting role="php">
2399
-
<![CDATA[
2400
-
<?php
2401
-

2402
-
/* http://localhost/upload.php:
2403
-
print_r($_POST);
2404
-
print_r($_FILES);
2405
-
*/
2406
-

2407
-
$ch = curl_init();
2408
-

2409
-
$data = array('name' => 'Foo', 'file' => '@/home/user/test.png');
2410
-

2411
-
curl_setopt($ch, CURLOPT_URL, 'http://localhost/upload.php');
2412
-
curl_setopt($ch, CURLOPT_POST, 1);
2413
-
curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false); // required as of PHP 5.6.0
2414
-
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
2415
-

2416
-
curl_exec($ch);
2417
-
?>
2418
-
]]>
2419
-
</programlisting>
2420
-
&example.outputs;
2421
-
<screen>
2422
-
<![CDATA[
2423
-
Array
2424
-
(
2425
-
[name] => Foo
2426
-
)
2427
-
Array
2428
-
(
2429
-
[file] => Array
2430
-
(
2431
-
[name] => test.png
2432
-
[type] => image/png
2433
-
[tmp_name] => /tmp/phpcpjNeQ
2434
-
[error] => 0
2435
-
[size] => 279
2436
-
)
2437
-

2438
-
)
2439
-

2440
-
]]>
2441
-
</screen>
2442
-
</example>
2443
-
</para>
2444
165
</refsect1>
2445
166

2446
167
<refsect1 role="notes">
...
...
@@ -2460,12 +181,13 @@ Array
2460
181
<para>
2461
182
<simplelist>
2462
183
<member><function>curl_setopt_array</function></member>
184
+
<member><classname>CURLFile</classname></member>
185
+
<member><classname>CURLStringFile</classname></member>
2463
186
</simplelist>
2464
187
</para>
2465
188
</refsect1>
2466
189

2467
190
</refentry>
2468
-

2469
191
<!-- Keep this comment at the end of the file
2470
192
Local variables:
2471
193
mode: sgml
2472
194