Func Curl_Multi_Setopt
[ PHP cURL Reference Manual](#)
(PHP 5 >= 5.5.0)
curl_multi_setopt β Set an option for a cURL batch transfer.
* * *
## Description
bool curl_multi_setopt ( resource $mh , int $option , mixed $value )
Sets an option for a cURL batch transfer.
* * *
## Parameters
**ch**
The cURL handle returned by curl_init().
**option**
The CURLOPT_XXX option to set.
**value**
The value to set for the option.
For the following options, the value should be set to a bool type:
| Option | Possible _value_ values | Notes |
| --- | --- | --- |
| **CURLOPT_AUTOREFERER** | When following a _Location:_ header, automatically set the _Referer:_ header. | |
| **CURLOPT_BINARYTRANSFER** | Return the raw output when **CURLOPT_RETURNTRANSFER** is enabled. | |
| **CURLOPT_COOKIESESSION** | When enabled, curl will only send a session cookie, ignoring other cookies. By default, cURL will return all cookies to the server. A session cookie is one that is used to determine if the server-side session is valid. | |
| **CURLOPT_CRLF** | Convert Unix line breaks to Windows line breaks. | |
| **CURLOPT_DNS_USE_GLOBAL_CACHE** | Enable a global DNS cache. This is thread-safe and enabled by default. | |
| **CURLOPT_FAILONERROR** | Display HTTP status codes. The default behavior is to ignore HTTP information with codes less than or equal to 400. | |
| **CURLOPT_FILETIME** | Attempt to modify the remote document's information. The result information can be returned via the _CURLINFO_FILETIME_ option of the curl_getinfo() function. curl_getinfo(). | |
| **CURLOPT_FOLLOWLOCATION** | When enabled, recursively return the _"Location: "_ header from the server in the header. Use **CURLOPT_MAXREDIRS** to limit the number of recursive returns. | |
| **CURLOPT_FORBID_REUSE** | Force close the connection after the transfer, preventing reuse. | |
| **CURLOPT_FRESH_CONNECT** | Force a new connection, replacing any cached one. | |
| **CURLOPT_FTP_USE_EPRT** | When enabled, use the EPRT (or LPRT) command for FTP downloads. Set to **FALSE** to disable EPRT and LPRT, using only the PORT command. | |
| **CURLOPT_FTP_USE_EPSV** | When enabled, try the EPSV command before reverting to PASV mode during FTP transfer. Set to **FALSE** to disable the EPSV command. | |
| **CURLOPT_FTPAPPEND** | When enabled, append to the file instead of overwriting it. | |
| **CURLOPT_FTPASCII** | Alias for **CURLOPT_TRANSFERTEXT**. | |
| **CURLOPT_FTPLISTONLY** | When enabled, list only FTP directory names. | |
| **CURLOPT_HEADER** | When enabled, output the header information as a data stream. | |
| **CURLINFO_HEADER_OUT** | When enabled, track the handle's request string. | Available since PHP 5.1.3. The **CURLINFO_** prefix is intentional. |
| **CURLOPT_HTTPGET** | When enabled, set the HTTP method to GET. Since GET is the default, this is only used if modified. | |
| **CURLOPT_HTTPPROXYTUNNEL** | When enabled, tunnel through an HTTP proxy. | |
| **CURLOPT_MUTE** | When enabled, restore all modified parameters in cURL functions to their default values. | |
| **CURLOPT_NETRC** | After the connection is established, access the ~/.netrc file to get username and password information for connecting to the remote site. | |
| **CURLOPT_NOBODY** | When enabled, do not output the BODY part of an HTML document. | |
| **CURLOPT_NOPROGRESS** | When enabled, disable the progress bar for curl transfers. This is enabled by default. > **Note**: > > > PHP automatically sets this option to **TRUE**. This option should only be changed for debugging purposes. | |
| **CURLOPT_NOSIGNAL** | When enabled, ignore all signals passed from curl to PHP. This is enabled by default in SAPI multi-threaded transfers. | Added in cURL 7.10. |
| **CURLOPT_POST** | When enabled, send a regular POST request of type: _application/x-www-form-urlencoded_, similar to a form submission. | |
| **CURLOPT_PUT** | When enabled, allow HTTP to send files. Must also set **CURLOPT_INFILE** and **CURLOPT_INFILESIZE**. | |
| **CURLOPT_RETURNTRANSFER** | Return the information obtained by curl_exec() as a file stream instead of directly outputting it. | |
| **CURLOPT_SSL_VERIFYPEER** | When disabled, cURL will stop verifying the server. Use **CURLOPT_CAINFO** to set the certificate and **CURLOPT_CAPATH** to set the certificate directory. If **CURLOPT_SSL_VERIFYPEER** (default is 2) is enabled, **CURLOPT_SSL_VERIFYHOST** needs to be set to **TRUE**, otherwise set to **FALSE**. | Default is **TRUE** since cURL 7.10. Bundled installation default since cURL 7.10. |
| **CURLOPT_TRANSFERTEXT** | When enabled, use ASCII mode for FTP transfers. For LDAP, it retrieves plain text information instead of HTML. On Windows, the system will not set _STDOUT_ to binary mode. | |
| **CURLOPT_UNRESTRICTED_AUTH** | Continue appending username and password information in headers generated by **CURLOPT_FOLLOWLOCATION** across multiple locations, even if the domain changes. | |
| **CURLOPT_UPLOAD** | When enabled, allow file uploads. | |
| **CURLOPT_VERBOSE** | When enabled, report all information, stored in _STDERR_ or the specified **CURLOPT_STDERR**. | |
* * *
## Return Values
Returns TRUE on success, or FALSE on failure.
* * PHP cURL Reference Manual](#)
YouTip