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,1424 +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_DNS_USE_GLOBAL_CACHE</constant></entry>
123
-
<entry valign="top">
124
-
&true; to use a global DNS cache. This option is
125
-
not thread-safe and is enabled by default.
126
-
</entry>
127
-
<entry valign="top">
128
-
</entry>
129
-
</row>
130
-
<row>
131
-
<entry valign="top"><constant>CURLOPT_FAILONERROR</constant></entry>
132
-
<entry valign="top">
133
-
&true; to fail verbosely if the HTTP code returned
134
-
is greater than or equal to 400. The default behavior is to return
135
-
the page normally, ignoring the code.
136
-
</entry>
137
-
<entry valign="top">
138
-
</entry>
139
-
</row>
140
-
<row>
141
-
<entry valign="top"><constant>CURLOPT_FILETIME</constant></entry>
142
-
<entry valign="top">
143
-
&true; to attempt to retrieve the modification
144
-
date of the remote document. This value can be retrieved using
145
-
the <parameter>CURLINFO_FILETIME</parameter> option with
146
-
<function>curl_getinfo</function>.
147
-
</entry>
148
-
<entry valign="top">
149
-
</entry>
150
-
</row>
151
-
<row>
152
-
<entry valign="top"><constant>CURLOPT_FOLLOWLOCATION</constant></entry>
153
-
<entry valign="top">
154
-
&true; to follow any
155
-
<literal>"Location: "</literal> header that the server sends as
156
-
part of the HTTP header (note this is recursive, PHP will follow as
157
-
many <literal>"Location: "</literal> headers that it is sent,
158
-
unless <constant>CURLOPT_MAXREDIRS</constant> is set).
159
-
</entry>
160
-
<entry valign="top">
161
-
</entry>
162
-
</row>
163
-
<row>
164
-
<entry valign="top"><constant>CURLOPT_FORBID_REUSE</constant></entry>
165
-
<entry valign="top">
166
-
&true; to force the connection to explicitly
167
-
close when it has finished processing, and not be pooled for reuse.
168
-
</entry>
169
-
<entry valign="top">
170
-
</entry>
171
-
</row>
172
-
<row>
173
-
<entry valign="top"><constant>CURLOPT_FRESH_CONNECT</constant></entry>
174
-
<entry valign="top">
175
-
&true; to force the use of a new connection
176
-
instead of a cached one.
177
-
</entry>
178
-
<entry valign="top">
179
-
</entry>
180
-
</row>
181
-
<row>
182
-
<entry valign="top"><constant>CURLOPT_FTP_USE_EPRT</constant></entry>
183
-
<entry valign="top">
184
-
&true; to use EPRT (and LPRT) when doing active
185
-
FTP downloads. Use &false; to disable EPRT and LPRT and use PORT
186
-
only.
187
-
</entry>
188
-
<entry valign="top">
189
-
</entry>
190
-
</row>
191
-
<row>
192
-
<entry valign="top"><constant>CURLOPT_FTP_USE_EPSV</constant></entry>
193
-
<entry valign="top">
194
-
&true; to first try an EPSV command for FTP
195
-
transfers before reverting back to PASV. Set to &false;
196
-
to disable EPSV.
197
-
</entry>
198
-
<entry valign="top">
199
-
</entry>
200
-
</row>
201
-
<row>
202
-
<entry valign="top"><constant>CURLOPT_FTP_CREATE_MISSING_DIRS</constant></entry>
203
-
<entry valign="top">
204
-
&true; to create missing directories when an FTP operation
205
-
encounters a path that currently doesn't exist.
206
-
</entry>
207
-
<entry valign="top">
208
-
</entry>
209
-
</row>
210
-
<row>
211
-
<entry valign="top"><constant>CURLOPT_FTPAPPEND</constant></entry>
212
-
<entry valign="top">
213
-
&true; to append to the remote file instead of
214
-
overwriting it.
215
-
</entry>
216
-
<entry valign="top">
217
-
</entry>
218
-
</row>
219
-
<row>
220
-
<entry valign="top"><constant>CURLOPT_TCP_NODELAY</constant></entry>
221
-
<entry valign="top">
222
-
&true; to disable TCP's Nagle algorithm, which tries to minimize
223
-
the number of small packets on the network.
224
-
</entry>
225
-
<entry valign="top">
226
-
Available since PHP 5.2.1 for versions compiled with libcurl 7.11.2 or
227
-
greater.
228
-
</entry>
229
-
</row>
230
-
<row>
231
-
<entry valign="top"><constant>CURLOPT_FTPASCII</constant></entry>
232
-
<entry valign="top">
233
-
An alias of
234
-
<constant>CURLOPT_TRANSFERTEXT</constant>. Use that instead.
235
-
</entry>
236
-
<entry valign="top">
237
-
</entry>
238
-
</row>
239
-
<row>
240
-
<entry valign="top"><constant>CURLOPT_FTPLISTONLY</constant></entry>
241
-
<entry valign="top">
242
-
&true; to only list the names of an FTP
243
-
directory.
244
-
</entry>
245
-
<entry valign="top">
246
-
</entry>
247
-
</row>
248
-
<row>
249
-
<entry valign="top"><constant>CURLOPT_HEADER</constant></entry>
250
-
<entry valign="top">
251
-
&true; to include the header in the output.
252
-
</entry>
253
-
<entry valign="top">
254
-
</entry>
255
-
</row>
256
-
<row>
257
-
<entry><constant>CURLINFO_HEADER_OUT</constant></entry>
258
-
<entry valign="top">
259
-
&true; to track the handle's request string.
260
-
</entry>
261
-
<entry valign="top">
262
-
Available since PHP 5.1.3. The <constant>CURLINFO_</constant>
263
-
prefix is intentional.
264
-
</entry>
265
-
</row>
266
-
<row>
267
-
<entry valign="top"><constant>CURLOPT_HTTPGET</constant></entry>
268
-
<entry valign="top">
269
-
&true; to reset the HTTP request method to GET.
270
-
Since GET is the default, this is only necessary if the request
271
-
method has been changed.
272
-
</entry>
273
-
<entry valign="top">
274
-
</entry>
275
-
</row>
276
-
<row>
277
-
<entry valign="top"><constant>CURLOPT_HTTPPROXYTUNNEL</constant></entry>
278
-
<entry valign="top">
279
-
&true; to tunnel through a given HTTP proxy.
280
-
</entry>
281
-
<entry valign="top">
282
-
</entry>
283
-
</row>
284
-
<row>
285
-
<entry valign="top"><constant>CURLOPT_MUTE</constant></entry>
286
-
<entry valign="top">
287
-
&true; to be completely silent with regards to
288
-
the cURL functions.
289
-
</entry>
290
-
<entry valign="top">
291
-
Removed in cURL 7.15.5 (You can use CURLOPT_RETURNTRANSFER instead)
292
-
</entry>
293
-
</row>
294
-
<row>
295
-
<entry valign="top"><constant>CURLOPT_NETRC</constant></entry>
296
-
<entry valign="top">
297
-
&true; to scan the <filename>~/.netrc</filename>
298
-
file to find a username and password for the remote site that
299
-
a connection is being established with.
300
-
</entry>
301
-
<entry valign="top">
302
-
</entry>
303
-
</row>
304
-
<row>
305
-
<entry valign="top"><constant>CURLOPT_NOBODY</constant></entry>
306
-
<entry valign="top">
307
-
&true; to exclude the body from the output.
308
-
Request method is then set to HEAD. Changing this to &false; does
309
-
not change it to GET.
310
-
</entry>
311
-
<entry valign="top">
312
-
</entry>
313
-
</row>
314
-
<row>
315
-
<entry valign="top"><constant>CURLOPT_NOPROGRESS</constant></entry>
316
-
<entry valign="top"><para>
317
-
&true; to disable the progress meter for cURL transfers.
318
-
<note>
319
-
<para>
320
-
PHP automatically sets this option to &true;, this should only be
321
-
changed for debugging purposes.
322
-
</para>
323
-
</note>
324
-
</para></entry>
325
-
<entry valign="top">
326
-
</entry>
327
-
</row>
328
-
<row>
329
-
<entry valign="top"><constant>CURLOPT_NOSIGNAL</constant></entry>
330
-
<entry valign="top">
331
-
&true; to ignore any cURL function that causes a
332
-
signal to be sent to the PHP process. This is turned on by default
333
-
in multi-threaded SAPIs so timeout options can still be used.
334
-
</entry>
335
-
<entry valign="top">
336
-
Added in cURL 7.10.
337
-
</entry>
338
-
</row>
339
-
<row>
340
-
<entry valign="top"><constant>CURLOPT_POST</constant></entry>
341
-
<entry valign="top">
342
-
&true; to do a regular HTTP POST. This POST is the
343
-
normal <literal>application/x-www-form-urlencoded</literal> kind,
344
-
most commonly used by HTML forms.
345
-
</entry>
346
-
<entry valign="top">
347
-
</entry>
348
-
</row>
349
-
<row>
350
-
<entry valign="top"><constant>CURLOPT_PUT</constant></entry>
351
-
<entry valign="top">
352
-
&true; to HTTP PUT a file. The file to PUT must
353
-
be set with <constant>CURLOPT_INFILE</constant> and
354
-
<constant>CURLOPT_INFILESIZE</constant>.
355
-
</entry>
356
-
<entry valign="top">
357
-
</entry>
358
-
</row>
359
-
<row>
360
-
<entry valign="top"><constant>CURLOPT_RETURNTRANSFER</constant></entry>
361
-
<entry valign="top">
362
-
&true; to return the transfer as a string of the
363
-
return value of <function>curl_exec</function> instead of outputting
364
-
it out directly.
365
-
</entry>
366
-
<entry valign="top">
367
-
</entry>
368
-
</row>
369
-
<row>
370
-
<entry valign="top"><constant>CURLOPT_SAFE_UPLOAD</constant></entry>
371
-
<entry valign="top">
372
-
&true; to disable support for the <literal>@</literal> prefix for
373
-
uploading files in <constant>CURLOPT_POSTFIELDS</constant>, which
374
-
means that values starting with <literal>@</literal> can be safely
375
-
passed as fields. <classname>CURLFile</classname> may be used for
376
-
uploads instead.
377
-
</entry>
378
-
<entry valign="top">
379
-
Added in PHP 5.5.0 with &false; as the default value. PHP 5.6.0
380
-
changes the default value to &true;.
381
-
</entry>
382
-
</row>
383
-
<row>
384
-
<entry valign="top"><constant>CURLOPT_SSL_VERIFYPEER</constant></entry>
385
-
<entry valign="top">
386
-
&false; to stop cURL from verifying the peer's
387
-
certificate. Alternate certificates to verify against can be
388
-
specified with the <constant>CURLOPT_CAINFO</constant> option
389
-
or a certificate directory can be specified with the
390
-
<constant>CURLOPT_CAPATH</constant> option.
391
-
</entry>
392
-
<entry valign="top">
393
-
&true; by default as of cURL 7.10. Default bundle installed as of
394
-
cURL 7.10.
395
-
</entry>
396
-
</row>
397
-
<row>
398
-
<entry valign="top"><constant>CURLOPT_TRANSFERTEXT</constant></entry>
399
-
<entry valign="top">
400
-
&true; to use ASCII mode for FTP transfers.
401
-
For LDAP, it retrieves data in plain text instead of HTML. On
402
-
Windows systems, it will not set <literal>STDOUT</literal> to binary
403
-
mode.
404
-
</entry>
405
-
<entry valign="top">
406
-
</entry>
407
-
</row>
408
-
<row>
409
-
<entry valign="top"><constant>CURLOPT_UNRESTRICTED_AUTH</constant></entry>
410
-
<entry valign="top">
411
-
&true; to keep sending the username and password
412
-
when following locations (using
413
-
<constant>CURLOPT_FOLLOWLOCATION</constant>), even when the
414
-
hostname has changed.
415
-
</entry>
416
-
<entry valign="top">
417
-
</entry>
418
-
</row>
419
-
<row>
420
-
<entry valign="top"><constant>CURLOPT_UPLOAD</constant></entry>
421
-
<entry valign="top">
422
-
&true; to prepare for an upload.
423
-
</entry>
424
-
<entry valign="top">
425
-
</entry>
426
-
</row>
427
-
<row>
428
-
<entry valign="top"><constant>CURLOPT_VERBOSE</constant></entry>
429
-
<entry valign="top">
430
-
&true; to output verbose information. Writes
431
-
output to <literal>STDERR</literal>, or the file specified using
432
-
<constant>CURLOPT_STDERR</constant>.
433
-
</entry>
434
-
<entry valign="top">
435
-
</entry>
436
-
</row>
437
-
</tbody>
438
-
</tgroup>
439
-
</informaltable>
440
-
</para>
441
-
<para>
442
-
<parameter>value</parameter> should be an <type>integer</type> for the
443
-
following values of the <parameter>option</parameter> parameter:
444
-
<informaltable>
445
-
<tgroup cols="3">
446
-
<thead>
447
-
<row>
448
-
<entry>Option</entry>
449
-
<entry>Set <parameter>value</parameter> to</entry>
450
-
<entry>Notes</entry>
451
-
</row>
452
-
</thead>
453
-
<tbody>
454
-
<row>
455
-
<entry valign="top"><constant>CURLOPT_BUFFERSIZE</constant></entry>
456
-
<entry valign="top">
457
-
The size of the buffer to use for each read. There is no guarantee
458
-
this request will be fulfilled, however.
459
-
</entry>
460
-
<entry valign="top">
461
-
Added in cURL 7.10.
462
-
</entry>
463
-
</row>
464
-
<row>
465
-
<entry valign="top"><constant>CURLOPT_CLOSEPOLICY</constant></entry>
466
-
<entry valign="top">
467
-
One of the <constant>CURLCLOSEPOLICY_*</constant> values.
468
-
<note>
469
-
<para>
470
-
This option is deprecated, as it was never implemented in cURL and
471
-
never had any effect.
472
-
</para>
473
-
</note>
474
-
</entry>
475
-
<entry valign="top">
476
-
Removed in PHP 5.6.0.
477
-
</entry>
478
-
</row>
479
-
<row>
480
-
<entry><constant>CURLOPT_CONNECTTIMEOUT</constant></entry>
481
-
<entry valign="top">
482
-
The number of seconds to wait while trying to connect. Use 0 to
483
-
wait indefinitely.
484
-
</entry>
485
-
<entry valign="top">
486
-
</entry>
487
-
</row>
488
-
<row>
489
-
<entry valign="top"><constant>CURLOPT_CONNECTTIMEOUT_MS</constant></entry>
490
-
<entry valign="top">
491
-
The number of milliseconds to wait while trying to connect. Use 0 to
492
-
wait indefinitely.
493
-
<!-- http://curl.haxx.se/libcurl/c/curl_easy_setopt.html -->
494
-
If libcurl is built to use the standard system name resolver, that
495
-
portion of the connect will still use full-second resolution for
496
-
timeouts with a minimum timeout allowed of one second.
497
-
</entry>
498
-
<entry valign="top">
499
-
Added in cURL 7.16.2. Available since PHP 5.2.3.
500
-
</entry>
501
-
</row>
502
-
<row>
503
-
<entry valign="top"><constant>CURLOPT_DNS_CACHE_TIMEOUT</constant></entry>
504
-
<entry valign="top">
505
-
The number of seconds to keep DNS entries in memory. This
506
-
option is set to 120 (2 minutes) by default.
507
-
</entry>
508
-
<entry valign="top">
509
-
</entry>
510
-
</row>
511
-
<row>
512
-
<entry valign="top"><constant>CURLOPT_FTPSSLAUTH</constant></entry>
513
-
<entry valign="top">
514
-
The FTP authentication method (when is activated):
515
-
<literal>CURLFTPAUTH_SSL</literal> (try SSL first),
516
-
<literal>CURLFTPAUTH_TLS</literal> (try TLS first), or
517
-
<literal>CURLFTPAUTH_DEFAULT</literal> (let cURL decide).
518
-
</entry>
519
-
<entry valign="top">
520
-
Added in cURL 7.12.2.
521
-
</entry>
522
-
</row>
523
-
<row>
524
-
<entry valign="top"><constant>CURLOPT_HTTP_VERSION</constant></entry>
525
-
<entry valign="top">
526
-
<parameter>CURL_HTTP_VERSION_NONE</parameter> (default, lets CURL
527
-
decide which version to use),
528
-
<parameter>CURL_HTTP_VERSION_1_0</parameter> (forces HTTP/1.0),
529
-
or <parameter>CURL_HTTP_VERSION_1_1</parameter> (forces HTTP/1.1).
530
-
</entry>
531
-
<entry valign="top">
532
-
</entry>
533
-
</row>
534
-
<row>
535
-
<entry valign="top"><constant>CURLOPT_HTTPAUTH</constant></entry>
536
-
<entry valign="top">
537
-
<para>
538
-
The HTTP authentication method(s) to use. The options are:
539
-
<parameter>CURLAUTH_BASIC</parameter>,
540
-
<parameter>CURLAUTH_DIGEST</parameter>,
541
-
<parameter>CURLAUTH_GSSNEGOTIATE</parameter>,
542
-
<parameter>CURLAUTH_NTLM</parameter>,
543
-
<parameter>CURLAUTH_ANY</parameter>, and
544
-
<parameter>CURLAUTH_ANYSAFE</parameter>.
545
-
</para>
546
-
<para>
547
-
The bitwise <literal>|</literal> (or) operator can be used to combine
548
-
more than one method. If this is done, cURL will poll the server to see
549
-
what methods it supports and pick the best one.
550
-
</para>
551
-
<para>
552
-
<parameter>CURLAUTH_ANY</parameter> is an alias for
553
-
<literal>CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM</literal>.
554
-
</para>
555
-
<para>
556
-
<parameter>CURLAUTH_ANYSAFE</parameter> is an alias for
557
-
<literal>CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM</literal>.
558
-
</para>
559
-
</entry>
560
-
<entry valign="top">
561
-
</entry>
562
-
</row>
563
-
<row>
564
-
<entry valign="top"><constant>CURLOPT_INFILESIZE</constant></entry>
565
-
<entry valign="top">
566
-
The expected size, in bytes, of the file when uploading a file to
567
-
a remote site. Note that using this option will not stop libcurl
568
-
from sending more data, as exactly what is sent depends on
569
-
<constant>CURLOPT_READFUNCTION</constant>.
570
-
</entry>
571
-
<entry valign="top">
572
-
</entry>
573
-
</row>
574
-
<row>
575
-
<entry valign="top"><constant>CURLOPT_LOW_SPEED_LIMIT</constant></entry>
576
-
<entry valign="top">
577
-
The transfer speed, in bytes per second, that the transfer should be
578
-
below during the count of <constant>CURLOPT_LOW_SPEED_TIME</constant>
579
-
seconds before PHP considers the transfer too slow and aborts.
580
-
</entry>
581
-
<entry valign="top">
582
-
</entry>
583
-
</row>
584
-
<row>
585
-
<entry valign="top"><constant>CURLOPT_LOW_SPEED_TIME</constant></entry>
586
-
<entry valign="top">
587
-
The number of seconds the transfer speed should be below
588
-
<constant>CURLOPT_LOW_SPEED_LIMIT</constant> before PHP considers
589
-
the transfer too slow and aborts.
590
-
</entry>
591
-
<entry valign="top">
592
-
</entry>
593
-
</row>
594
-
<row>
595
-
<entry valign="top"><constant>CURLOPT_MAXCONNECTS</constant></entry>
596
-
<entry valign="top">
597
-
The maximum amount of persistent connections that are allowed.
598
-
When the limit is reached,
599
-
<constant>CURLOPT_CLOSEPOLICY</constant> is used to determine
600
-
which connection to close.
601
-
</entry>
602
-
<entry valign="top">
603
-
</entry>
604
-
</row>
605
-
<row>
606
-
<entry valign="top"><constant>CURLOPT_MAXREDIRS</constant></entry>
607
-
<entry valign="top">
608
-
The maximum amount of HTTP redirections to follow. Use this option
609
-
alongside <constant>CURLOPT_FOLLOWLOCATION</constant>.
610
-
</entry>
611
-
<entry valign="top">
612
-
</entry>
613
-
</row>
614
-
<row>
615
-
<entry valign="top"><constant>CURLOPT_PORT</constant></entry>
616
-
<entry valign="top">
617
-
An alternative port number to connect to.
618
-
</entry>
619
-
<entry valign="top">
620
-
</entry>
621
-
</row>
622
-
<row>
623
-
<entry valign="top"><constant>CURLOPT_POSTREDIR</constant></entry>
624
-
<entry valign="top">
625
-
A bitmask of 1 (301 Moved Permanently), 2 (302 Found)
626
-
and 4 (303 See Other) if the HTTP POST method should be maintained
627
-
when <constant>CURLOPT_FOLLOWLOCATION</constant> is set and a
628
-
specific type of redirect occurs.
629
-
</entry>
630
-
<entry valign="top">
631
-
Added in cURL 7.19.1. Available since PHP 5.3.2.
632
-
</entry>
633
-
</row>
634
-
<row>
635
-
<entry valign="top"><constant>CURLOPT_PROTOCOLS</constant></entry>
636
-
<entry valign="top">
637
-
<para>
638
-
Bitmask of <constant>CURLPROTO_*</constant> values. If used, this bitmask
639
-
limits what protocols libcurl may use in the transfer. This allows you to have
640
-
a libcurl built to support a wide range of protocols but still limit specific
641
-
transfers to only be allowed to use a subset of them. By default libcurl will
642
-
accept all protocols it supports.
643
-
See also <constant>CURLOPT_REDIR_PROTOCOLS</constant>.
644
-
</para>
645
-
<para>
646
-
Valid protocol options are:
647
-
<parameter>CURLPROTO_HTTP</parameter>,
648
-
<parameter>CURLPROTO_HTTPS</parameter>,
649
-
<parameter>CURLPROTO_FTP</parameter>,
650
-
<parameter>CURLPROTO_FTPS</parameter>,
651
-
<parameter>CURLPROTO_SCP</parameter>,
652
-
<parameter>CURLPROTO_SFTP</parameter>,
653
-
<parameter>CURLPROTO_TELNET</parameter>,
654
-
<parameter>CURLPROTO_LDAP</parameter>,
655
-
<parameter>CURLPROTO_LDAPS</parameter>,
656
-
<parameter>CURLPROTO_DICT</parameter>,
657
-
<parameter>CURLPROTO_FILE</parameter>,
658
-
<parameter>CURLPROTO_TFTP</parameter>,
659
-
<parameter>CURLPROTO_ALL</parameter>
660
-
</para>
661
-
</entry>
662
-
<entry valign="top">
663
-
Added in cURL 7.19.4.
664
-
</entry>
665
-
</row>
666
-
<row>
667
-
<entry valign="top"><constant>CURLOPT_PROXYAUTH</constant></entry>
668
-
<entry valign="top">
669
-
The HTTP authentication method(s) to use for the proxy connection.
670
-
Use the same bitmasks as described in
671
-
<constant>CURLOPT_HTTPAUTH</constant>. For proxy authentication,
672
-
only <parameter>CURLAUTH_BASIC</parameter> and
673
-
<parameter>CURLAUTH_NTLM</parameter> are currently supported.
674
-
</entry>
675
-
<entry valign="top">
676
-
Added in cURL 7.10.7.
677
-
</entry>
678
-
</row>
679
-
<row>
680
-
<entry valign="top"><constant>CURLOPT_PROXYPORT</constant></entry>
681
-
<entry valign="top">
682
-
The port number of the proxy to connect to. This port number can
683
-
also be set in <constant>CURLOPT_PROXY</constant>.
684
-
</entry>
685
-
<entry valign="top">
686
-
</entry>
687
-
</row>
688
-
<row>
689
-
<entry valign="top"><constant>CURLOPT_PROXYTYPE</constant></entry>
690
-
<entry valign="top">
691
-
Either <constant>CURLPROXY_HTTP</constant> (default),
692
-
<constant>CURLPROXY_SOCKS4</constant>,
693
-
<constant>CURLPROXY_SOCKS5</constant>,
694
-
<constant>CURLPROXY_SOCKS4A</constant> or
695
-
<constant>CURLPROXY_SOCKS5_HOSTNAME</constant>.
696
-
</entry>
697
-
<entry valign="top">
698
-
Added in cURL 7.10.
699
-
</entry>
700
-
</row>
701
-
<row>
702
-
<entry valign="top"><constant>CURLOPT_REDIR_PROTOCOLS</constant></entry>
703
-
<entry valign="top">
704
-
Bitmask of <constant>CURLPROTO_*</constant> values. If used, this bitmask
705
-
limits what protocols libcurl may use in a transfer that it follows to in
706
-
a redirect when <constant>CURLOPT_FOLLOWLOCATION</constant> is enabled.
707
-
This allows you to limit specific transfers to only be allowed to use a subset
708
-
of protocols in redirections. By default libcurl will allow all protocols
709
-
except for FILE and SCP. This is a difference compared to pre-7.19.4 versions
710
-
which unconditionally would follow to all protocols supported.
711
-
See also <constant>CURLOPT_PROTOCOLS</constant> for protocol constant values.
712
-
</entry>
713
-
<entry valign="top">
714
-
Added in cURL 7.19.4.
715
-
</entry>
716
-
</row>
717
-
<row>
718
-
<entry valign="top"><constant>CURLOPT_RESUME_FROM</constant></entry>
719
-
<entry valign="top">
720
-
The offset, in bytes, to resume a transfer from.
721
-
</entry>
722
-
<entry valign="top">
723
-
</entry>
724
-
</row>
725
-
<row>
726
-
<entry valign="top"><constant>CURLOPT_SSL_VERIFYHOST</constant></entry>
727
-
<entry valign="top">
728
-
1 to check the existence of a common name in the
729
-
SSL peer certificate. 2 to check the existence of
730
-
a common name and also verify that it matches the hostname
731
-
provided. In production environments the value of this option
732
-
should be kept at 2 (default value).
733
-
</entry>
734
-
<entry valign="top">
735
-
Support for value 1 removed in cURL 7.28.1
736
-
</entry>
737
-
</row>
738
-
<row>
739
-
<entry valign="top"><constant>CURLOPT_SSLVERSION</constant></entry>
740
-
<entry valign="top">
741
-
One of <constant>CURL_SSLVERSION_DEFAULT</constant> (0),
742
-
<constant>CURL_SSLVERSION_TLSv1</constant> (1),
743
-
<constant>CURL_SSLVERSION_SSLv2</constant> (2),
744
-
<constant>CURL_SSLVERSION_SSLv3</constant> (3),
745
-
<constant>CURL_SSLVERSION_TLSv1_0</constant> (4),
746
-
<constant>CURL_SSLVERSION_TLSv1_1</constant> (5) or
747
-
<constant>CURL_SSLVERSION_TLSv1_2</constant> (6).
748
-
<note>
749
-
<para>
750
-
Your best bet is to not set this and let it use the default.
751
-
Setting it to 2 or 3 is very dangerous given the known
752
-
vulnerabilities in SSLv2 and SSLv3.
753
-
</para>
754
-
</note>
755
-
</entry>
756
-
<entry valign="top">
757
-
</entry>
758
-
</row>
759
-
<row>
760
-
<entry valign="top"><constant>CURLOPT_TIMECONDITION</constant></entry>
761
-
<entry valign="top">
762
-
How <constant>CURLOPT_TIMEVALUE</constant> is treated.
763
-
Use <parameter>CURL_TIMECOND_IFMODSINCE</parameter> to return the
764
-
page only if it has been modified since the time specified in
765
-
<constant>CURLOPT_TIMEVALUE</constant>. If it hasn't been modified,
766
-
a <literal>"304 Not Modified"</literal> header will be returned
767
-
assuming <constant>CURLOPT_HEADER</constant> is &true;.
768
-
Use <parameter>CURL_TIMECOND_IFUNMODSINCE</parameter> for the reverse
769
-
effect. <parameter>CURL_TIMECOND_IFMODSINCE</parameter> is the
770
-
default.
771
-
</entry>
772
-
<entry valign="top">
773
-
</entry>
774
-
</row>
775
-
<row>
776
-
<entry valign="top"><constant>CURLOPT_TIMEOUT</constant></entry>
777
-
<entry valign="top">
778
-
The maximum number of seconds to allow cURL functions to execute.
779
-
</entry>
780
-
<entry valign="top">
781
-
</entry>
782
-
</row>
783
-
<row>
784
-
<entry valign="top"><constant>CURLOPT_TIMEOUT_MS</constant></entry>
785
-
<entry valign="top">
786
-
The maximum number of milliseconds to allow cURL functions to
787
-
execute.
788
-
<!-- http://curl.haxx.se/libcurl/c/curl_easy_setopt.html -->
789
-
If libcurl is built to use the standard system name resolver, that
790
-
portion of the connect will still use full-second resolution for
791
-
timeouts with a minimum timeout allowed of one second.
792
-
</entry>
793
-
<entry valign="top">
794
-
Added in cURL 7.16.2. Available since PHP 5.2.3.
795
-
</entry>
796
-
</row>
797
-
<row>
798
-
<entry valign="top"><constant>CURLOPT_TIMEVALUE</constant></entry>
799
-
<entry valign="top">
800
-
The time in seconds since January 1st, 1970. The time will be used
801
-
by <constant>CURLOPT_TIMECONDITION</constant>. By default,
802
-
<parameter>CURL_TIMECOND_IFMODSINCE</parameter> is used.
803
-
</entry>
804
-
<entry valign="top">
805
-
</entry>
806
-
</row>
807
-
<row>
808
-
<entry valign="top"><constant>CURLOPT_MAX_RECV_SPEED_LARGE</constant></entry>
809
-
<entry valign="top">
810
-
If a download exceeds this speed (counted in bytes per second) on
811
-
cumulative average during the transfer, the transfer will pause to
812
-
keep the average rate less than or equal to the parameter value.
813
-
Defaults to unlimited speed.
814
-
</entry>
815
-
<entry valign="top">
816
-
Added in cURL 7.15.5. Available since PHP 5.4.0.
817
-
</entry>
818
-
</row>
819
-
<row>
820
-
<entry valign="top"><constant>CURLOPT_MAX_SEND_SPEED_LARGE</constant></entry>
821
-
<entry valign="top">
822
-
If an upload exceeds this speed (counted in bytes per second) on
823
-
cumulative average during the transfer, the transfer will pause to
824
-
keep the average rate less than or equal to the parameter value.
825
-
Defaults to unlimited speed.
826
-
</entry>
827
-
<entry valign="top">
828
-
Added in cURL 7.15.5. Available since PHP 5.4.0.
829
-
</entry>
830
-
</row>
831
-
<row>
832
-
<entry valign="top"><constant>CURLOPT_SSH_AUTH_TYPES</constant></entry>
833
-
<entry valign="top">
834
-
A bitmask consisting of one or more of
835
-
<constant>CURLSSH_AUTH_PUBLICKEY</constant>,
836
-
<constant>CURLSSH_AUTH_PASSWORD</constant>,
837
-
<constant>CURLSSH_AUTH_HOST</constant>,
838
-
<constant>CURLSSH_AUTH_KEYBOARD</constant>. Set to
839
-
<constant>CURLSSH_AUTH_ANY</constant> to let libcurl pick one.
840
-
</entry>
841
-
<entry valign="top">
842
-
Added in cURL 7.16.1.
843
-
</entry>
844
-
</row>
845
-
<row>
846
-
<entry valign="top"><constant>CURLOPT_IPRESOLVE</constant></entry>
847
-
<entry valign="top">
848
-
Allows an application to select what kind of IP addresses to use when
849
-
resolving host names. This is only interesting when using host names that
850
-
resolve addresses using more than one version of IP, possible values are
851
-
<constant>CURL_IPRESOLVE_WHATEVER</constant>,
852
-
<constant>CURL_IPRESOLVE_V4</constant>,
853
-
<constant>CURL_IPRESOLVE_V6</constant>, by default
854
-
<constant>CURL_IPRESOLVE_WHATEVER</constant>.
855
-
</entry>
856
-
<entry valign="top">
857
-
Added in cURL 7.10.8.
858
-
</entry>
859
-
</row>
860
-
</tbody>
861
-
</tgroup>
862
-
</informaltable>
863
-
</para>
864
-
<para>
865
-
<parameter>value</parameter> should be a <type>string</type> for the
866
-
following values of the <parameter>option</parameter> parameter:
867
-
<informaltable>
868
-
<tgroup cols="3">
869
-
<thead>
870
-
<row>
871
-
<entry>Option</entry>
872
-
<entry>Set <parameter>value</parameter> to</entry>
873
-
<entry>Notes</entry>
874
-
</row>
875
-
</thead>
876
-
<tbody>
877
-
<row>
878
-
<entry valign="top"><constant>CURLOPT_CAINFO</constant></entry>
879
-
<entry valign="top">
880
-
The name of a file holding one or more certificates to verify the
881
-
peer with. This only makes sense when used in combination with
882
-
<constant>CURLOPT_SSL_VERIFYPEER</constant>.
883
-
</entry>
884
-
<entry valign="top">
885
-
Might require an absolute path.
886
-
</entry>
887
-
</row>
888
-
<row>
889
-
<entry valign="top"><constant>CURLOPT_CAPATH</constant></entry>
890
-
<entry valign="top">
891
-
A directory that holds multiple CA certificates. Use this option
892
-
alongside <constant>CURLOPT_SSL_VERIFYPEER</constant>.
893
-
</entry>
894
-
<entry valign="top">
895
-
</entry>
896
-
</row>
897
-
<row>
898
-
<entry valign="top"><constant>CURLOPT_COOKIE</constant></entry>
899
-
<entry valign="top">
900
-
The contents of the <literal>"Cookie: "</literal> header to be
901
-
used in the HTTP request.
902
-
Note that multiple cookies are separated with a semicolon followed
903
-
by a space (e.g., "<literal>fruit=apple; colour=red</literal>")
904
-
</entry>
905
-
<entry valign="top">
906
-
</entry>
907
-
</row>
908
-
<row>
909
-
<entry valign="top"><constant>CURLOPT_COOKIEFILE</constant></entry>
910
-
<entry valign="top">
911
-
The name of the file containing the cookie data. The cookie file can
912
-
be in Netscape format, or just plain HTTP-style headers dumped into
913
-
a file.
914
-
If the name is an empty string, no cookies are loaded, but cookie
915
-
handling is still enabled.
916
-
</entry>
917
-
<entry valign="top">
918
-
</entry>
919
-
</row>
920
-
<row>
921
-
<entry valign="top"><constant>CURLOPT_COOKIEJAR</constant></entry>
922
-
<entry valign="top">
923
-
The name of a file to save all internal cookies to when the handle is closed,
924
-
e.g. after a call to curl_close.
925
-
</entry>
926
-
<entry valign="top">
927
-
</entry>
928
-
</row>
929
-
<row>
930
-
<entry valign="top"><constant>CURLOPT_CUSTOMREQUEST</constant></entry>
931
-
<entry valign="top"><para>
932
-
A custom request method to use instead of
933
-
<literal>"GET"</literal> or <literal>"HEAD"</literal> when doing
934
-
a HTTP request. This is useful for doing
935
-
<literal>"DELETE"</literal> or other, more obscure HTTP requests.
936
-
Valid values are things like <literal>"GET"</literal>,
937
-
<literal>"POST"</literal>, <literal>"CONNECT"</literal> and so on;
938
-
i.e. Do not enter a whole HTTP request line here. For instance,
939
-
entering <literal>"GET /index.html HTTP/1.0\r\n\r\n"</literal>
940
-
would be incorrect.
941
-
<note>
942
-
<para>
943
-
Don't do this without making sure the server supports the custom
944
-
request method first.
945
-
</para>
946
-
</note>
947
-
</para></entry>
948
-
<entry valign="top">
949
-
</entry>
950
-
</row>
951
-
<row>
952
-
<entry valign="top"><constant>CURLOPT_EGDSOCKET</constant></entry>
953
-
<entry valign="top">
954
-
Like <constant>CURLOPT_RANDOM_FILE</constant>, except a filename
955
-
to an Entropy Gathering Daemon socket.
956
-
</entry>
957
-
<entry valign="top">
958
-
</entry>
959
-
</row>
960
-
<row>
961
-
<entry valign="top"><constant>CURLOPT_ENCODING</constant></entry>
962
-
<entry valign="top">
963
-
The contents of the <literal>"Accept-Encoding: "</literal> header.
964
-
This enables decoding of the response. Supported encodings are
965
-
<literal>"identity"</literal>, <literal>"deflate"</literal>, and
966
-
<literal>"gzip"</literal>. If an empty string, <literal>""</literal>,
967
-
is set, a header containing all supported encoding types is sent.
968
-
</entry>
969
-
<entry valign="top">
970
-
Added in cURL 7.10.
971
-
</entry>
972
-
</row>
973
-
<row>
974
-
<entry valign="top"><constant>CURLOPT_FTPPORT</constant></entry>
975
-
<entry valign="top">
976
-
The value which will be used to get the IP address to use
977
-
for the FTP "PORT" instruction. The "PORT" instruction tells
978
-
the remote server to connect to our specified IP address. The
979
-
string may be a plain IP address, a hostname, a network
980
-
interface name (under Unix), or just a plain '-' to use the
981
-
systems default IP address.
982
-
</entry>
983
-
<entry valign="top">
984
-
</entry>
985
-
</row>
986
-
<row>
987
-
<entry valign="top"><constant>CURLOPT_INTERFACE</constant></entry>
988
-
<entry valign="top">
989
-
The name of the outgoing network interface to use. This can be an
990
-
interface name, an IP address or a host name.
991
-
</entry>
992
-
<entry valign="top">
993
-
</entry>
994
-
</row>
995
-
<row>
996
-
<entry valign="top"><constant>CURLOPT_KEYPASSWD</constant></entry>
997
-
<entry valign="top">
998
-
The password required to use the <constant>CURLOPT_SSLKEY</constant>
999
-
or <constant>CURLOPT_SSH_PRIVATE_KEYFILE</constant> private key.
1000
-
</entry>
1001
-
<entry valign="top">
1002
-
Added in cURL 7.16.1.
1003
-
</entry>
1004
-
</row>
1005
-
<row>
1006
-
<entry valign="top"><constant>CURLOPT_KRB4LEVEL</constant></entry>
1007
-
<entry valign="top">
1008
-
The KRB4 (Kerberos 4) security level. Any of the following values
1009
-
(in order from least to most powerful) are valid:
1010
-
<literal>"clear"</literal>,
1011
-
<literal>"safe"</literal>,
1012
-
<literal>"confidential"</literal>,
1013
-
<literal>"private".</literal>.
1014
-
If the string does not match one of these,
1015
-
<literal>"private"</literal> is used. Setting this option to &null;
1016
-
will disable KRB4 security. Currently KRB4 security only works
1017
-
with FTP transactions.
1018
-
</entry>
1019
-
<entry valign="top">
1020
-
</entry>
1021
-
</row>
1022
-
<row>
1023
-
<entry valign="top"><constant>CURLOPT_POSTFIELDS</constant></entry>
1024
-
<entry valign="top">
1025
-
<simpara>
1026
-
The full data to post in a HTTP "POST" operation.
1027
-
To post a file, prepend a filename with <literal>@</literal> and
1028
-
use the full path. The filetype can be explicitly specified by
1029
-
following the filename with the type in the format
1030
-
'<literal>;type=mimetype</literal>'. This parameter can either be
1031
-
passed as a urlencoded string like '<literal>para1=val1&amp;para2=val2&amp;...</literal>'
1032
-
or as an array with the field name as key and field data as value.
1033
-
If <parameter>value</parameter> is an array, the
1034
-
<literal>Content-Type</literal> header will be set to
1035
-
<literal>multipart/form-data</literal>.
1036
-
</simpara>
1037
-
<simpara>
1038
-
As of PHP 5.2.0, <parameter>value</parameter> must be an array if
1039
-
files are passed to this option with the <literal>@</literal> prefix.
1040
-
</simpara>
1041
-
<simpara>
1042
-
As of PHP 5.5.0, the <literal>@</literal> prefix is deprecated and
1043
-
files can be sent using <classname>CURLFile</classname>. The
1044
-
<literal>@</literal> prefix can be disabled for safe passing of
1045
-
values beginning with <literal>@</literal> by setting the
1046
-
<constant>CURLOPT_SAFE_UPLOAD</constant> option to &true;.
1047
-
</simpara>
1048
-
</entry>
1049
-
<entry valign="top">
1050
-
</entry>
1051
-
</row>
1052
-
<row>
1053
-
<entry valign="top"><constant>CURLOPT_PROXY</constant></entry>
1054
-
<entry valign="top">
1055
-
The HTTP proxy to tunnel requests through.
1056
-
</entry>
1057
-
<entry valign="top">
1058
-
</entry>
1059
-
</row>
1060
-
<row>
1061
-
<entry valign="top"><constant>CURLOPT_PROXYUSERPWD</constant></entry>
1062
-
<entry valign="top">
1063
-
A username and password formatted as
1064
-
<literal>"[username]:[password]"</literal> to use for the
1065
-
connection to the proxy.
1066
-
</entry>
1067
-
<entry valign="top">
1068
-
</entry>
1069
-
</row>
1070
-
<row>
1071
-
<entry valign="top"><constant>CURLOPT_RANDOM_FILE</constant></entry>
1072
-
<entry valign="top">
1073
-
A filename to be used to seed the random number generator for SSL.
1074
-
</entry>
1075
-
<entry valign="top">
1076
-
</entry>
1077
-
</row>
1078
-
<row>
1079
-
<entry valign="top"><constant>CURLOPT_RANGE</constant></entry>
1080
-
<entry valign="top">
1081
-
Range(s) of data to retrieve in the format
1082
-
<literal>"X-Y"</literal> where X or Y are optional. HTTP transfers
1083
-
also support several intervals, separated with commas in the format
1084
-
<literal>"X-Y,N-M"</literal>.
1085
-
</entry>
1086
-
<entry valign="top">
1087
-
</entry>
1088
-
</row>
1089
-
<row>
1090
-
<entry valign="top"><constant>CURLOPT_REFERER</constant></entry>
1091
-
<entry valign="top">
1092
-
The contents of the <literal>"Referer: "</literal> header to be used
1093
-
in a HTTP request.
1094
-
</entry>
1095
-
<entry valign="top">
1096
-
</entry>
1097
-
</row>
1098
-
<row>
1099
-
<entry valign="top"><constant>CURLOPT_SSH_HOST_PUBLIC_KEY_MD5</constant></entry>
1100
-
<entry valign="top">
1101
-
A string containing 32 hexadecimal digits. The string should be the
1102
-
MD5 checksum of the remote host's public key, and libcurl will reject
1103
-
the connection to the host unless the md5sums match.
1104
-
This option is only for SCP and SFTP transfers.
1105
-
</entry>
1106
-
<entry valign="top">
1107
-
Added in cURL 7.17.1.
1108
-
</entry>
1109
-
</row>
1110
-
<row>
1111
-
<entry valign="top"><constant>CURLOPT_SSH_PUBLIC_KEYFILE</constant></entry>
1112
-
<entry valign="top">
1113
-
The file name for your public key. If not used, libcurl defaults to
1114
-
$HOME/.ssh/id_dsa.pub if the HOME environment variable is set,
1115
-
and just "id_dsa.pub" in the current directory if HOME is not set.
1116
-
</entry>
1117
-
<entry valign="top">
1118
-
Added in cURL 7.16.1.
1119
-
</entry>
1120
-
</row>
1121
-
<row>
1122
-
<entry valign="top"><constant>CURLOPT_SSH_PRIVATE_KEYFILE</constant></entry>
1123
-
<entry valign="top">
1124
-
The file name for your private key. If not used, libcurl defaults to
1125
-
$HOME/.ssh/id_dsa if the HOME environment variable is set,
1126
-
and just "id_dsa" in the current directory if HOME is not set.
1127
-
If the file is password-protected, set the password with
1128
-
<constant>CURLOPT_KEYPASSWD</constant>.
1129
-
</entry>
1130
-
<entry valign="top">
1131
-
Added in cURL 7.16.1.
1132
-
</entry>
1133
-
</row>
1134
-
<row>
1135
-
<entry valign="top"><constant>CURLOPT_SSL_CIPHER_LIST</constant></entry>
1136
-
<entry valign="top">
1137
-
A list of ciphers to use for SSL. For example,
1138
-
<literal>RC4-SHA</literal> and <literal>TLSv1</literal> are valid
1139
-
cipher lists.
1140
-
</entry>
1141
-
<entry valign="top">
1142
-
</entry>
1143
-
</row>
1144
-
<row>
1145
-
<entry valign="top"><constant>CURLOPT_SSLCERT</constant></entry>
1146
-
<entry valign="top">
1147
-
The name of a file containing a PEM formatted certificate.
1148
-
</entry>
1149
-
<entry valign="top">
1150
-
</entry>
1151
-
</row>
1152
-
<row>
1153
-
<entry valign="top"><constant>CURLOPT_SSLCERTPASSWD</constant></entry>
1154
-
<entry valign="top">
1155
-
The password required to use the
1156
-
<constant>CURLOPT_SSLCERT</constant> certificate.
1157
-
</entry>
1158
-
<entry valign="top">
1159
-
</entry>
1160
-
</row>
1161
-
<row>
1162
-
<entry valign="top"><constant>CURLOPT_SSLCERTTYPE</constant></entry>
1163
-
<entry valign="top">
1164
-
The format of the certificate. Supported formats are
1165
-
<literal>"PEM"</literal> (default), <literal>"DER"</literal>,
1166
-
and <literal>"ENG"</literal>.
1167
-
</entry>
1168
-
<entry valign="top">
1169
-
Added in cURL 7.9.3.
1170
-
</entry>
1171
-
</row>
1172
-
<row>
1173
-
<entry valign="top"><constant>CURLOPT_SSLENGINE</constant></entry>
1174
-
<entry valign="top">
1175
-
The identifier for the crypto engine of the private SSL key
1176
-
specified in <constant>CURLOPT_SSLKEY</constant>.
1177
-
</entry>
1178
-
<entry valign="top">
1179
-
</entry>
1180
-
</row>
1181
-
<row>
1182
-
<entry valign="top"><constant>CURLOPT_SSLENGINE_DEFAULT</constant></entry>
1183
-
<entry valign="top">
1184
-
The identifier for the crypto engine used for asymmetric crypto
1185
-
operations.
1186
-
</entry>
1187
-
<entry valign="top">
1188
-
</entry>
1189
-
</row>
1190
-
<row>
1191
-
<entry valign="top"><constant>CURLOPT_SSLKEY</constant></entry>
1192
-
<entry valign="top">
1193
-
The name of a file containing a private SSL key.
1194
-
</entry>
1195
-
<entry valign="top">
1196
-
</entry>
1197
-
</row>
1198
-
<row>
1199
-
<entry valign="top"><constant>CURLOPT_SSLKEYPASSWD</constant></entry>
1200
-
<entry valign="top"><para>
1201
-
The secret password needed to use the private SSL key specified in
1202
-
<constant>CURLOPT_SSLKEY</constant>.
1203
-
<note>
1204
-
<para>
1205
-
Since this option contains a sensitive password, remember to keep
1206
-
the PHP script it is contained within safe.
1207
-
</para>
1208
-
</note>
1209
-
</para></entry>
1210
-
<entry valign="top">
1211
-
</entry>
1212
-
</row>
1213
-
<row>
1214
-
<entry valign="top"><constant>CURLOPT_SSLKEYTYPE</constant></entry>
1215
-
<entry valign="top">
1216
-
The key type of the private SSL key specified in
1217
-
<constant>CURLOPT_SSLKEY</constant>. Supported key types are
1218
-
<literal>"PEM"</literal> (default), <literal>"DER"</literal>,
1219
-
and <literal>"ENG"</literal>.
1220
-
</entry>
1221
-
<entry valign="top">
1222
-
</entry>
1223
-
</row>
1224
-
<row>
1225
-
<entry valign="top"><constant>CURLOPT_URL</constant></entry>
1226
-
<entry valign="top">
1227
-
The URL to fetch. This can also be set when initializing a
1228
-
session with <function>curl_init</function>.
1229
-
</entry>
1230
-
<entry valign="top">
1231
-
</entry>
1232
-
</row>
1233
-
<row>
1234
-
<entry valign="top"><constant>CURLOPT_USERAGENT</constant></entry>
1235
-
<entry valign="top">
1236
-
The contents of the <literal>"User-Agent: "</literal> header to be
1237
-
used in a HTTP request.
1238
-
</entry>
1239
-
<entry valign="top">
1240
-
</entry>
1241
-
</row>
1242
-
<row>
1243
-
<entry valign="top"><constant>CURLOPT_USERPWD</constant></entry>
1244
-
<entry valign="top">
1245
-
A username and password formatted as
1246
-
<literal>"[username]:[password]"</literal> to use for the
1247
-
connection.
1248
-
</entry>
1249
-
<entry valign="top">
1250
-
</entry>
1251
-
</row>
1252
-
</tbody>
1253
-
</tgroup>
1254
-
</informaltable>
1255
-
</para>
1256
-
<para>
1257
-
<parameter>value</parameter> should be an array for the
1258
-
following values of the <parameter>option</parameter> parameter:
1259
-
<informaltable>
1260
-
<tgroup cols="3">
1261
-
<thead>
1262
-
<row>
1263
-
<entry>Option</entry>
1264
-
<entry>Set <parameter>value</parameter> to</entry>
1265
-
<entry>Notes</entry>
1266
-
</row>
1267
-
</thead>
1268
-
<tbody>
1269
-
<row>
1270
-
<entry valign="top"><constant>CURLOPT_HTTP200ALIASES</constant></entry>
1271
-
<entry valign="top">
1272
-
An array of HTTP 200 responses that will be treated as valid
1273
-
responses and not as errors.
1274
-
</entry>
1275
-
<entry valign="top">
1276
-
Added in cURL 7.10.3.
1277
-
</entry>
1278
-
</row>
1279
-
<row>
1280
-
<entry valign="top"><constant>CURLOPT_HTTPHEADER</constant></entry>
1281
-
<entry valign="top">
1282
-
An array of HTTP header fields to set, in the format
1283
-
<code>
1284
-
array('Content-type: text/plain', 'Content-length: 100')
1285
-
</code>
1286
-
</entry>
1287
-
<entry valign="top">
1288
-
</entry>
1289
-
</row>
1290
-
<row>
1291
-
<entry valign="top"><constant>CURLOPT_POSTQUOTE</constant></entry>
1292
-
<entry valign="top">
1293
-
An array of FTP commands to execute on the server after the FTP
1294
-
request has been performed.
1295
-
</entry>
1296
-
<entry valign="top">
1297
-
</entry>
1298
-
</row>
1299
-
<row>
1300
-
<entry valign="top"><constant>CURLOPT_QUOTE</constant></entry>
1301
-
<entry valign="top">
1302
-
An array of FTP commands to execute on the server prior to the FTP
1303
-
request.
1304
-
</entry>
1305
-
<entry valign="top">
1306
-
</entry>
1307
-
</row>
1308
-
</tbody>
1309
-
</tgroup>
1310
-
</informaltable>
1311
-
</para>
1312
-
<para>
1313
-
<parameter>value</parameter> should be a stream resource (using
1314
-
<function>fopen</function>, for example) for the following values of the
1315
-
<parameter>option</parameter> parameter:
1316
-
<informaltable>
1317
-
<tgroup cols="3">
1318
-
<thead>
1319
-
<row>
1320
-
<entry>Option</entry>
1321
-
<entry>Set <parameter>value</parameter> to</entry>
1322
-
</row>
1323
-
</thead>
1324
-
<tbody>
1325
-
<row>
1326
-
<entry valign="top"><constant>CURLOPT_FILE</constant></entry>
1327
-
<entry valign="top">
1328
-
The file that the transfer should be written to. The default
1329
-
is <literal>STDOUT</literal> (the browser window).
1330
-
</entry>
1331
-
</row>
1332
-
<row>
1333
-
<entry valign="top"><constant>CURLOPT_INFILE</constant></entry>
1334
-
<entry valign="top">
1335
-
The file that the transfer should be read from when uploading.
1336
-
</entry>
1337
-
</row>
1338
-
<row>
1339
-
<entry valign="top"><constant>CURLOPT_STDERR</constant></entry>
1340
-
<entry valign="top">
1341
-
An alternative location to output errors to instead of
1342
-
<literal>STDERR</literal>.
1343
-
</entry>
1344
-
</row>
1345
-
<row>
1346
-
<entry valign="top"><constant>CURLOPT_WRITEHEADER</constant></entry>
1347
-
<entry valign="top">
1348
-
The file that the header part of the transfer is written to.
1349
-
</entry>
1350
-
</row>
1351
-
</tbody>
1352
-
</tgroup>
1353
-
</informaltable>
1354
-
</para>
1355
-
<para>
1356
-
<parameter>value</parameter> should be the name of a valid function or a Closure
1357
-
for the following values of the <parameter>option</parameter> parameter:
1358
-
<informaltable>
1359
-
<tgroup cols="3">
1360
-
<thead>
1361
-
<row>
1362
-
<entry>Option</entry>
1363
-
<entry>Set <parameter>value</parameter> to</entry>
1364
-
</row>
1365
-
</thead>
1366
-
<tbody>
1367
-
<row>
1368
-
<entry valign="top"><constant>CURLOPT_HEADERFUNCTION</constant></entry>
1369
-
<entry valign="top">
1370
-
A callback accepting two parameters.
1371
-
The first is the cURL resource, the second is a
1372
-
string with the header data to be written. The header data must
1373
-
be written by this callback. Return the number of
1374
-
bytes written.
1375
-
</entry>
1376
-
</row>
1377
-
<row>
1378
-
<entry valign="top"><constant>CURLOPT_PASSWDFUNCTION</constant></entry>
1379
-
<entry valign="top">
1380
-
A callback accepting three parameters.
1381
-
The first is the cURL resource, the second is a
1382
-
string containing a password prompt, and the third is the maximum
1383
-
password length. Return the string containing the password.
1384
-
</entry>
1385
-
</row>
1386
-
<row>
1387
-
<entry valign="top"><constant>CURLOPT_PROGRESSFUNCTION</constant></entry>
1388
-
<entry valign="top">
1389
-
<para>
1390
-
A callback accepting five parameters.
1391
-
The first is the cURL resource, the second is the total number of
1392
-
bytes expected to be downloaded in this transfer, the third is
1393
-
the number of bytes downloaded so far, the fourth is the total
1394
-
number of bytes expected to be uploaded in this transfer, and the
1395
-
fifth is the number of bytes uploaded so far.
1396
-
</para>
1397
-
<note>
1398
-
<para>
1399
-
The callback is only called when the <constant>CURLOPT_NOPROGRESS</constant>
1400
-
option is set to &false;.
1401
-
</para>
1402
-
</note>
1403
-
<para>
1404
-
Return a non-zero value to abort the transfer. In which case, the
1405
-
transfer will set a <constant>CURLE_ABORTED_BY_CALLBACK</constant>
1406
-
error.
1407
-
</para>
1408
-
</entry>
1409
-
</row>
1410
-
<row>
1411
-
<entry valign="top"><constant>CURLOPT_READFUNCTION</constant></entry>
1412
-
<entry valign="top">
1413
-
A callback accepting three parameters.
1414
-
The first is the cURL resource, the second is a
1415
-
stream resource provided to cURL through the option
1416
-
<constant>CURLOPT_INFILE</constant>, and the third is the maximum
1417
-
amount of data to be read. The callback must return a string
1418
-
with a length equal or smaller than the amount of data requested,
1419
-
typically by reading it from the passed stream resource. It should
1420
-
return an empty string to signal <literal>EOF</literal>.
1421
-
</entry>
1422
-
</row>
1423
-
<row>
1424
-
<entry valign="top"><constant>CURLOPT_WRITEFUNCTION</constant></entry>
1425
-
<entry valign="top">
1426
-
A callback accepting two parameters.
1427
-
The first is the cURL resource, and the second is a
1428
-
string with the data to be written. The data must be saved by
1429
-
this callback. It must return the exact number of bytes written
1430
-
or the transfer will be aborted with an error.
1431
-
</entry>
1432
-
</row>
1433
-
</tbody>
1434
-
</tgroup>
1435
-
</informaltable>
1436
-
</para>
1437
-
<para>
1438
-
Other values:
1439
-
<informaltable>
1440
-
<tgroup cols="3">
1441
-
<thead>
1442
-
<row>
1443
-
<entry>Option</entry>
1444
-
<entry>Set <parameter>value</parameter> to</entry>
1445
-
</row>
1446
-
</thead>
1447
-
<tbody>
1448
-
<row>
1449
-
<entry valign="top"><constant>CURLOPT_SHARE</constant></entry>
1450
-
<entry valign="top">
1451
-
A result of <function>curl_share_init</function>. Makes the cURL
1452
-
handle to use the data from the shared handle.
1453
-
</entry>
1454
-
</row>
1455
-
</tbody>
1456
-
</tgroup>
1457
-
</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.
1458
43
</para>
1459
44
</listitem>
1460
45
</varlistentry>
...
...
@@ -1482,65 +67,68 @@
1482
67
</thead>
1483
68
<tbody>
1484
69
<row>
1485
-
<entry>5.6.0</entry>
1486
-
<entry>
1487
-
<constant>CURLOPT_SAFE_UPLOAD</constant> is now &true; by default.
1488
-
</entry>
1489
-
</row>
1490
-
<row>
1491
-
<entry>5.6.0</entry>
1492
-
<entry>
1493
-
Removed <constant>CURLOPT_CLOSEPOLICY</constant> and associated values.
1494
-
</entry>
1495
-
</row>
1496
-
<row>
1497
-
<entry>5.5.0</entry>
1498
-
<entry>
1499
-
Added the cURL resource as the first argument to the
1500
-
<constant>CURLOPT_PROGRESSFUNCTION</constant> callback.
1501
-
</entry>
1502
-
</row>
1503
-
<row>
1504
-
<entry>5.5.0</entry>
70
+
<entry>8.4.0</entry>
1505
71
<entry>
1506
-
Introduced <constant>CURLOPT_SHARE</constant>.
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.
1507
74
</entry>
1508
75
</row>
76
+
&curl.changelog.handle-param;
1509
77
<row>
1510
-
<entry>5.3.0</entry>
78
+
<entry>7.3.15, 7.4.3</entry>
1511
79
<entry>
1512
-
Introduced <constant>CURLOPT_PROGRESSFUNCTION</constant>.
80
+
Introduced <constant>CURLOPT_HTTP09_ALLOWED</constant>.
1513
81
</entry>
1514
82
</row>
1515
83
<row>
1516
-
<entry>5.2.10</entry>
84
+
<entry>7.3.0</entry>
1517
85
<entry>
1518
-
Introduced <constant>CURLOPT_PROTOCOLS</constant>, and
1519
-
<constant>CURLOPT_REDIR_PROTOCOLS</constant>.
86
+
Introduced <constant>CURLOPT_ABSTRACT_UNIX_SOCKET</constant>, <constant>CURLOPT_KEEP_SENDING_ON_ERROR</constant>,
87
+
<constant>CURLOPT_PRE_PROXY</constant>, <constant>CURLOPT_PROXY_CAINFO</constant>,
88
+
<constant>CURLOPT_PROXY_CAPATH</constant>, <constant>CURLOPT_PROXY_CRLFILE</constant>,
89
+
<constant>CURLOPT_PROXY_KEYPASSWD</constant>, <constant>CURLOPT_PROXY_PINNEDPUBLICKEY</constant>,
90
+
<constant>CURLOPT_PROXY_SSLCERT</constant>, <constant>CURLOPT_PROXY_SSLCERTTYPE</constant>,
91
+
<constant>CURLOPT_PROXY_SSL_CIPHER_LIST</constant>, <constant>CURLOPT_PROXY_SSLKEY</constant>,
92
+
<constant>CURLOPT_PROXY_SSLKEYTYPE</constant>, <constant>CURLOPT_PROXY_SSL_OPTIONS</constant>,
93
+
<constant>CURLOPT_PROXY_SSL_VERIFYHOST</constant>, <constant>CURLOPT_PROXY_SSL_VERIFYPEER</constant>,
94
+
<constant>CURLOPT_PROXY_SSLVERSION</constant>, <constant>CURLOPT_PROXY_TLSAUTH_PASSWORD</constant>,
95
+
<constant>CURLOPT_PROXY_TLSAUTH_TYPE</constant>, <constant>CURLOPT_PROXY_TLSAUTH_USERNAME</constant>,
96
+
<constant>CURLOPT_SOCKS5_AUTH</constant>, <constant>CURLOPT_SUPPRESS_CONNECT_HEADERS</constant>,
97
+
<constant>CURLOPT_DISALLOW_USERNAME_IN_URL</constant>, <constant>CURLOPT_DNS_SHUFFLE_ADDRESSES</constant>,
98
+
<constant>CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS</constant>, <constant>CURLOPT_HAPROXYPROTOCOL</constant>,
99
+
<constant>CURLOPT_PROXY_TLS13_CIPHERS</constant>, <constant>CURLOPT_SSH_COMPRESSION</constant>,
100
+
<constant>CURLOPT_TIMEVALUE_LARGE</constant> and <constant>CURLOPT_TLS13_CIPHERS</constant>.
1520
101
</entry>
1521
102
</row>
1522
103
<row>
1523
-
<entry>5.1.0</entry>
104
+
<entry>7.0.7</entry>
1524
105
<entry>
1525
-
Introduced <constant>CURLOPT_AUTOREFERER</constant>,
1526
-
<constant>CURLOPT_BINARYTRANSFER</constant>,
1527
-
<constant>CURLOPT_FTPSSLAUTH</constant>,
1528
-
<constant>CURLOPT_PROXYAUTH</constant>, and
1529
-
<constant>CURLOPT_TIMECONDITION</constant>.
1530
-
</entry>
1531
-
</row>
1532
-
<row>
1533
-
<entry>5.0.0</entry>
1534
-
<entry>
1535
-
Introduced <constant>CURLOPT_FTP_USE_EPRT</constant>,
1536
-
<constant>CURLOPT_NOSIGNAL</constant>,
1537
-
<constant>CURLOPT_UNRESTRICTED_AUTH</constant>,
1538
-
<constant>CURLOPT_BUFFERSIZE</constant>,
1539
-
<constant>CURLOPT_HTTPAUTH</constant>,
1540
-
<constant>CURLOPT_PROXYPORT</constant>,
1541
-
<constant>CURLOPT_PROXYTYPE</constant>,
1542
-
<constant>CURLOPT_SSLCERTTYPE</constant>, and
1543
-
<constant>CURLOPT_HTTP200ALIASES</constant>.
106
+
Introduced <constant>CURL_HTTP_VERSION_2</constant>, <constant>CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE</constant>,
107
+
<constant>CURL_HTTP_VERSION_2TLS</constant>, <constant>CURL_REDIR_POST_301</constant>,
108
+
<constant>CURL_REDIR_POST_302</constant>, <constant>CURL_REDIR_POST_303</constant>,
109
+
<constant>CURL_REDIR_POST_ALL</constant>, <constant>CURL_VERSION_KERBEROS5</constant>,
110
+
<constant>CURL_VERSION_PSL</constant>, <constant>CURL_VERSION_UNIX_SOCKETS</constant>,
111
+
<constant>CURLAUTH_NEGOTIATE</constant>, <constant>CURLAUTH_NTLM_WB</constant>,
112
+
<constant>CURLFTP_CREATE_DIR</constant>, <constant>CURLFTP_CREATE_DIR_NONE</constant>,
113
+
<constant>CURLFTP_CREATE_DIR_RETRY</constant>, <constant>CURLHEADER_SEPARATE</constant>,
114
+
<constant>CURLHEADER_UNIFIED</constant>, <constant>CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE</constant>,
115
+
<constant>CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE</constant>, <constant>CURLMOPT_MAX_HOST_CONNECTIONS</constant>,
116
+
<constant>CURLMOPT_MAX_PIPELINE_LENGTH</constant>, <constant>CURLMOPT_MAX_TOTAL_CONNECTIONS</constant>,
117
+
<constant>CURLOPT_CONNECT_TO</constant>, <constant>CURLOPT_DEFAULT_PROTOCOL</constant>,
118
+
<constant>CURLOPT_DNS_INTERFACE</constant>, <constant>CURLOPT_DNS_LOCAL_IP4</constant>,
119
+
<constant>CURLOPT_DNS_LOCAL_IP6</constant>, <constant>CURLOPT_EXPECT_100_TIMEOUT_MS</constant>,
120
+
<constant>CURLOPT_HEADEROPT</constant>, <constant>CURLOPT_LOGIN_OPTIONS</constant>,
121
+
<constant>CURLOPT_PATH_AS_IS</constant>, <constant>CURLOPT_PINNEDPUBLICKEY</constant>,
122
+
<constant>CURLOPT_PIPEWAIT</constant>, <constant>CURLOPT_PROXY_SERVICE_NAME</constant>,
123
+
<constant>CURLOPT_PROXYHEADER</constant>, <constant>CURLOPT_SASL_IR</constant>,
124
+
<constant>CURLOPT_SERVICE_NAME</constant>, <constant>CURLOPT_SSL_ENABLE_ALPN</constant>,
125
+
<constant>CURLOPT_SSL_ENABLE_NPN</constant>, <constant>CURLOPT_SSL_FALSESTART</constant>,
126
+
<constant>CURLOPT_SSL_VERIFYSTATUS</constant>, <constant>CURLOPT_STREAM_WEIGHT</constant>,
127
+
<constant>CURLOPT_TCP_FASTOPEN</constant>, <constant>CURLOPT_TFTP_NO_OPTIONS</constant>,
128
+
<constant>CURLOPT_UNIX_SOCKET_PATH</constant>, <constant>CURLOPT_XOAUTH2_BEARER</constant>,
129
+
<constant>CURLPROTO_SMB</constant>, <constant>CURLPROTO_SMBS</constant>,
130
+
<constant>CURLPROXY_HTTP_1_0</constant>, <constant>CURLSSH_AUTH_AGENT</constant> and
131
+
<constant>CURLSSLOPT_NO_REVOKE</constant>.
1544
132
</entry>
1545
133
</row>
1546
134
</tbody>
...
...
@@ -1574,55 +162,6 @@ curl_close($ch);
1574
162
</programlisting>
1575
163
</example>
1576
164
</para>
1577
-
<para>
1578
-
<example>
1579
-
<title>Uploading file (deprecated as of PHP 5.5.0)</title>
1580
-
<programlisting role="php">
1581
-
<![CDATA[
1582
-
<?php
1583
-

1584
-
/* http://localhost/upload.php:
1585
-
print_r($_POST);
1586
-
print_r($_FILES);
1587
-
*/
1588
-

1589
-
$ch = curl_init();
1590
-

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

1593
-
curl_setopt($ch, CURLOPT_URL, 'http://localhost/upload.php');
1594
-
curl_setopt($ch, CURLOPT_POST, 1);
1595
-
curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false); // required as of PHP 5.6.0
1596
-
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
1597
-

1598
-
curl_exec($ch);
1599
-
?>
1600
-
]]>
1601
-
</programlisting>
1602
-
&example.outputs;
1603
-
<screen>
1604
-
<![CDATA[
1605
-
Array
1606
-
(
1607
-
[name] => Foo
1608
-
)
1609
-
Array
1610
-
(
1611
-
[file] => Array
1612
-
(
1613
-
[name] => test.png
1614
-
[type] => image/png
1615
-
[tmp_name] => /tmp/phpcpjNeQ
1616
-
[error] => 0
1617
-
[size] => 279
1618
-
)
1619
-

1620
-
)
1621
-

1622
-
]]>
1623
-
</screen>
1624
-
</example>
1625
-
</para>
1626
165
</refsect1>
1627
166

1628
167
<refsect1 role="notes">
...
...
@@ -1642,12 +181,13 @@ Array
1642
181
<para>
1643
182
<simplelist>
1644
183
<member><function>curl_setopt_array</function></member>
184
+
<member><classname>CURLFile</classname></member>
185
+
<member><classname>CURLStringFile</classname></member>
1645
186
</simplelist>
1646
187
</para>
1647
188
</refsect1>
1648
189

1649
190
</refentry>
1650
-

1651
191
<!-- Keep this comment at the end of the file
1652
192
Local variables:
1653
193
mode: sgml
1654
194