Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 2460

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Set an option for a cURL transfer</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.curl-setopt-array.html">curl_setopt_array</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.curl-share-close.html">curl_share_close</a></div>
 <div class="up"><a href="ref.curl.html">cURL Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.curl-setopt" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">curl_setopt</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.2, PHP 5)</p><p class="refpurpose"><span class="refname">curl_setopt</span> &mdash; <span class="dc-title">Set an option for a cURL transfer</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.curl-setopt-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>curl_setopt</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$ch</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$option</code></span>
   , <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$value</code></span>
   )</div>

  <p class="para rdfs-comment">
   Sets an option on the given cURL session handle.
  </p>
 </div>

 
 <div class="refsect1 parameters" id="refsect1-function.curl-setopt-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    <dt>
<span class="term"><em><code class="parameter">ch</code></em>
</span><dd>
<p class="para">A cURL handle returned by
 <span class="function"><a href="function.curl-init.html" class="function">curl_init()</a></span>.</p></dd>
</dt>

    <dt>

     <span class="term"><em><code class="parameter">option</code></em></span>
     <dd>

      <p class="para">
       The <em>CURLOPT_XXX</em> option to set.
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">value</code></em></span>
     <dd>

      <p class="para">
       The value to be set on <em><code class="parameter">option</code></em>.
      </p>
      <p class="para">
       <em><code class="parameter">value</code></em> should be a <span class="type"><a href="language.types.boolean.html" class="type bool">bool</a></span> for the
       following values of the <em><code class="parameter">option</code></em> parameter:
       <table class="doctable informaltable">
        
         <thead>
          <tr>
           <th>Option</th>
           <th>Set <em><code class="parameter">value</code></em> to</th>
           <th>Notes</th>
          </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_AUTOREFERER</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to automatically set the <em>Referer:</em> field in
            requests where it follows a <em>Location:</em> redirect.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_BINARYTRANSFER</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to return the raw output when
            <strong><code>CURLOPT_RETURNTRANSFER</code></strong> is used.
           </td>
           <td style="vertical-align: top;">
            From PHP 5.1.3, this option has no effect: the raw output will
            always be returned when
            <strong><code>CURLOPT_RETURNTRANSFER</code></strong> is used.
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_COOKIESESSION</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to mark this as a new cookie &quot;session&quot;. It will force libcurl
            to ignore all cookies it is about to load that are &quot;session cookies&quot;
            from the previous session. By default, libcurl always stores and
            loads all cookies, independent if they are session cookies or not.
            Session cookies are cookies without expiry date and they are meant
            to be alive and existing for this &quot;session&quot; only.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_CERTINFO</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to output SSL certification information to <em>STDERR</em>
            on secure transfers.
           </td>
           <td style="vertical-align: top;">
            Added in cURL 7.19.1. 
            Available since PHP 5.3.2. 
            Requires <strong><code>CURLOPT_VERBOSE</code></strong> to be on to have an effect.
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_CONNECT_ONLY</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> tells the library to perform all the required proxy authentication 
            and connection setup, but no data transfer. This option is implemented for 
            HTTP, SMTP and POP3.
           </td>
           <td style="vertical-align: top;">
            Added in 7.15.2.
            Available since PHP 5.5.0.
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_CRLF</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to convert Unix newlines to CRLF newlines
            on transfers.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_DNS_USE_GLOBAL_CACHE</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to use a global DNS cache. This option is
            not thread-safe and is enabled by default.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_FAILONERROR</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to fail verbosely if the HTTP code returned
            is greater than or equal to 400. The default behavior is to return
            the page normally, ignoring the code.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_FILETIME</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to attempt to retrieve the modification
            date of the remote document. This value can be retrieved using
            the <em><code class="parameter">CURLINFO_FILETIME</code></em> option with
             <span class="function"><a href="function.curl-getinfo.html" class="function">curl_getinfo()</a></span>.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_FOLLOWLOCATION</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to follow any
            <em>&quot;Location: &quot;</em> header that the server sends as
            part of the HTTP header (note this is recursive, PHP will follow as
            many <em>&quot;Location: &quot;</em> headers that it is sent,
            unless <strong><code>CURLOPT_MAXREDIRS</code></strong> is set).
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_FORBID_REUSE</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to force the connection to explicitly
            close when it has finished processing, and not be pooled for reuse.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_FRESH_CONNECT</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to force the use of a new connection
            instead of a cached one.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_FTP_USE_EPRT</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to use EPRT (and LPRT) when doing active
            FTP downloads. Use <strong><code>FALSE</code></strong> to disable EPRT and LPRT and use PORT
            only.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_FTP_USE_EPSV</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to first try an EPSV command for FTP
            transfers before reverting back to PASV. Set to <strong><code>FALSE</code></strong>
            to disable EPSV.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_FTP_CREATE_MISSING_DIRS</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to create missing directories when an FTP operation
            encounters a path that currently doesn&#039;t exist.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_FTPAPPEND</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to append to the remote file instead of
            overwriting it.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_FTPASCII</code></strong></td>
           <td style="vertical-align: top;">
            An alias of
            <strong><code>CURLOPT_TRANSFERTEXT</code></strong>. Use that instead.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_FTPLISTONLY</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to only list the names of an FTP
            directory.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_HEADER</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to include the header in the output.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td><strong><code>CURLINFO_HEADER_OUT</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to track the handle&#039;s request string.
           </td>
           <td style="vertical-align: top;">
            Available since PHP 5.1.3. The <strong><code>CURLINFO_</code></strong>
            prefix is intentional.
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_HTTPGET</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to reset the HTTP request method to GET.
            Since GET is the default, this is only necessary if the request
            method has been changed.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_HTTPPROXYTUNNEL</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to tunnel through a given HTTP proxy.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_MUTE</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to be completely silent with regards to
            the cURL functions.
           </td>
           <td style="vertical-align: top;">
            Removed in cURL 7.15.5 (You can use CURLOPT_RETURNTRANSFER instead)
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_NETRC</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to scan the <var class="filename">~/.netrc</var>
            file to find a username and password for the remote site that
            a connection is being established with.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_NOBODY</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to exclude the body from the output.
            Request method is then set to HEAD. Changing this to <strong><code>FALSE</code></strong> does
            not change it to GET.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_NOPROGRESS</code></strong></td>
           <td style="vertical-align: top;"><p class="para">
            <strong><code>TRUE</code></strong> to disable the progress meter for cURL transfers.
            <blockquote class="note"><p><strong class="note">Note</strong>: 
             <p class="para">
              PHP automatically sets this option to <strong><code>TRUE</code></strong>, this should only be
              changed for debugging purposes.
             </p>
            </p></blockquote>
            </p></td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_NOSIGNAL</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to ignore any cURL function that causes a
            signal to be sent to the PHP process. This is turned on by default
            in multi-threaded SAPIs so timeout options can still be used.
           </td>
           <td style="vertical-align: top;">
            Added in cURL 7.10.
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_POST</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to do a regular HTTP POST. This POST is the
            normal <em>application/x-www-form-urlencoded</em> kind,
            most commonly used by HTML forms.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_PUT</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to HTTP PUT a file. The file to PUT must
            be set with <strong><code>CURLOPT_INFILE</code></strong> and
            <strong><code>CURLOPT_INFILESIZE</code></strong>.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_RETURNTRANSFER</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to return the transfer as a string of the
            return value of  <span class="function"><a href="function.curl-exec.html" class="function">curl_exec()</a></span> instead of outputting
            it out directly.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_SSL_VERIFYPEER</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>FALSE</code></strong> to stop cURL from verifying the peer&#039;s
            certificate. Alternate certificates to verify against can be
            specified with the <strong><code>CURLOPT_CAINFO</code></strong> option
            or a certificate directory can be specified with the
            <strong><code>CURLOPT_CAPATH</code></strong> option.
           </td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> by default as of cURL 7.10. Default bundle installed as of
            cURL 7.10.
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_TRANSFERTEXT</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to use ASCII mode for FTP transfers.
            For LDAP, it retrieves data in plain text instead of HTML. On
            Windows systems, it will not set <em>STDOUT</em> to binary
            mode.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_UNRESTRICTED_AUTH</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to keep sending the username and password
            when following locations (using
            <strong><code>CURLOPT_FOLLOWLOCATION</code></strong>), even when the
            hostname has changed.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_UPLOAD</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to prepare for an upload.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_VERBOSE</code></strong></td>
           <td style="vertical-align: top;">
            <strong><code>TRUE</code></strong> to output verbose information. Writes
            output to <em>STDERR</em>, or the file specified using
            <strong><code>CURLOPT_STDERR</code></strong>.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

         </tbody>
        
       </table>

      </p>
      <p class="para">
       <em><code class="parameter">value</code></em> should be an <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> for the
       following values of the <em><code class="parameter">option</code></em> parameter:
       <table class="doctable informaltable">
        
         <thead>
          <tr>
           <th>Option</th>
           <th>Set <em><code class="parameter">value</code></em> to</th>
           <th>Notes</th>
          </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_BUFFERSIZE</code></strong></td>
           <td style="vertical-align: top;">
            The size of the buffer to use for each read. There is no guarantee
            this request will be fulfilled, however.
           </td>
           <td style="vertical-align: top;">
            Added in cURL 7.10.
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_CLOSEPOLICY</code></strong></td>
           <td style="vertical-align: top;">
            Either
            <em><code class="parameter">CURLCLOSEPOLICY_LEAST_RECENTLY_USED</code></em> or
            <em><code class="parameter">CURLCLOSEPOLICY_OLDEST</code></em>.
            There are three other <em>CURLCLOSEPOLICY_</em>
            constants, but cURL does not support them yet.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td><strong><code>CURLOPT_CONNECTTIMEOUT</code></strong></td>
           <td style="vertical-align: top;">
            The number of seconds to wait while trying to connect. Use 0 to
            wait indefinitely.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_CONNECTTIMEOUT_MS</code></strong></td>
           <td style="vertical-align: top;">
            The number of milliseconds to wait while trying to connect. Use 0 to
            wait indefinitely.
            
            If libcurl is built to use the standard system name resolver, that
            portion of the connect will still use full-second resolution for
            timeouts with a minimum timeout allowed of one second.
           </td>
           <td style="vertical-align: top;">
            Added in cURL 7.16.2. Available since PHP 5.2.3.
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_DNS_CACHE_TIMEOUT</code></strong></td>
           <td style="vertical-align: top;">
            The number of seconds to keep DNS entries in memory. This
            option is set to 120 (2 minutes) by default.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_FTPSSLAUTH</code></strong></td>
           <td style="vertical-align: top;">
            The FTP authentication method (when is activated):
            <em>CURLFTPAUTH_SSL</em> (try SSL first),
            <em>CURLFTPAUTH_TLS</em> (try TLS first), or
            <em>CURLFTPAUTH_DEFAULT</em> (let cURL decide).
           </td>
           <td style="vertical-align: top;">
            Added in cURL 7.12.2.
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_HTTP_VERSION</code></strong></td>
           <td style="vertical-align: top;">
            <em><code class="parameter">CURL_HTTP_VERSION_NONE</code></em> (default, lets CURL
            decide which version to use),
            <em><code class="parameter">CURL_HTTP_VERSION_1_0</code></em> (forces HTTP/1.0),
            or <em><code class="parameter">CURL_HTTP_VERSION_1_1</code></em> (forces HTTP/1.1).
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_HTTPAUTH</code></strong></td>
           <td style="vertical-align: top;">
            <p class="para">
             The HTTP authentication method(s) to use. The options are:
             <em><code class="parameter">CURLAUTH_BASIC</code></em>,
             <em><code class="parameter">CURLAUTH_DIGEST</code></em>,
             <em><code class="parameter">CURLAUTH_GSSNEGOTIATE</code></em>,
             <em><code class="parameter">CURLAUTH_NTLM</code></em>,
             <em><code class="parameter">CURLAUTH_ANY</code></em>, and
             <em><code class="parameter">CURLAUTH_ANYSAFE</code></em>.
            </p>
            <p class="para">
             The bitwise <em>|</em> (or) operator can be used to combine
             more than one method. If this is done, cURL will poll the server to see
             what methods it supports and pick the best one.
            </p>
            <p class="para">
             <em><code class="parameter">CURLAUTH_ANY</code></em> is an alias for
             <em>CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM</em>.
            </p>
            <p class="para">
             <em><code class="parameter">CURLAUTH_ANYSAFE</code></em> is an alias for
             <em>CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM</em>.
            </p>
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_INFILESIZE</code></strong></td>
           <td style="vertical-align: top;">
            The expected size, in bytes, of the file when uploading a file to
            a remote site. Note that using this option will not stop libcurl
            from sending more data, as exactly what is sent depends on
            <strong><code>CURLOPT_READFUNCTION</code></strong>.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_LOW_SPEED_LIMIT</code></strong></td>
           <td style="vertical-align: top;">
            The transfer speed, in bytes per second, that the transfer should be
            below during the count of <strong><code>CURLOPT_LOW_SPEED_TIME</code></strong>
            seconds before PHP considers the transfer too slow and aborts.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_LOW_SPEED_TIME</code></strong></td>
           <td style="vertical-align: top;">
            The number of seconds the transfer speed should be below
            <strong><code>CURLOPT_LOW_SPEED_LIMIT</code></strong> before PHP considers
            the transfer too slow and aborts.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_MAXCONNECTS</code></strong></td>
           <td style="vertical-align: top;">
            The maximum amount of persistent connections that are allowed.
            When the limit is reached,
            <strong><code>CURLOPT_CLOSEPOLICY</code></strong> is used to determine
            which connection to close.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_MAXREDIRS</code></strong></td>
           <td style="vertical-align: top;">
            The maximum amount of HTTP redirections to follow. Use this option
            alongside <strong><code>CURLOPT_FOLLOWLOCATION</code></strong>.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_PORT</code></strong></td>
           <td style="vertical-align: top;">
            An alternative port number to connect to.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_PROTOCOLS</code></strong></td>
           <td style="vertical-align: top;">
            <p class="para">
             Bitmask of <strong><code>CURLPROTO_*</code></strong> values. If used, this bitmask 
             limits what protocols libcurl may use in the transfer. This allows you to have
             a libcurl built to support a wide range of protocols but still limit specific
             transfers to only be allowed to use a subset of them. By default libcurl will
             accept all protocols it supports. 
             See also <strong><code>CURLOPT_REDIR_PROTOCOLS</code></strong>.
            </p>
            <p class="para">
             Valid protocol options are: 
             <em><code class="parameter">CURLPROTO_HTTP</code></em>,
             <em><code class="parameter">CURLPROTO_HTTPS</code></em>,
             <em><code class="parameter">CURLPROTO_FTP</code></em>,
             <em><code class="parameter">CURLPROTO_FTPS</code></em>,
             <em><code class="parameter">CURLPROTO_SCP</code></em>,
             <em><code class="parameter">CURLPROTO_SFTP</code></em>,
             <em><code class="parameter">CURLPROTO_TELNET</code></em>,
             <em><code class="parameter">CURLPROTO_LDAP</code></em>,
             <em><code class="parameter">CURLPROTO_LDAPS</code></em>,
             <em><code class="parameter">CURLPROTO_DICT</code></em>,
             <em><code class="parameter">CURLPROTO_FILE</code></em>,
             <em><code class="parameter">CURLPROTO_TFTP</code></em>,
             <em><code class="parameter">CURLPROTO_ALL</code></em>
            </p>
           </td>
           <td style="vertical-align: top;">
            Added in cURL 7.19.4.
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_PROXYAUTH</code></strong></td>
           <td style="vertical-align: top;">
            The HTTP authentication method(s) to use for the proxy connection.
            Use the same bitmasks as described in
            <strong><code>CURLOPT_HTTPAUTH</code></strong>. For proxy authentication,
            only <em><code class="parameter">CURLAUTH_BASIC</code></em> and
            <em><code class="parameter">CURLAUTH_NTLM</code></em> are currently supported.
           </td>
           <td style="vertical-align: top;">
            Added in cURL 7.10.7.
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_PROXYPORT</code></strong></td>
           <td style="vertical-align: top;">
            The port number of the proxy to connect to. This port number can
            also be set in <strong><code>CURLOPT_PROXY</code></strong>.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_PROXYTYPE</code></strong></td>
           <td style="vertical-align: top;">
            Either <em><code class="parameter">CURLPROXY_HTTP</code></em> (default) or
            <em><code class="parameter">CURLPROXY_SOCKS5</code></em>.
           </td>
           <td style="vertical-align: top;">
            Added in cURL 7.10.
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_REDIR_PROTOCOLS</code></strong></td>
           <td style="vertical-align: top;">
            Bitmask of <strong><code>CURLPROTO_*</code></strong> values. If used, this bitmask
            limits what protocols libcurl may use in a transfer that it follows to in
            a redirect when <strong><code>CURLOPT_FOLLOWLOCATION</code></strong> is enabled.
            This allows you to limit specific transfers to only be allowed to use a subset
            of protocols in redirections. By default libcurl will allow all protocols
            except for FILE and SCP. This is a difference compared to pre-7.19.4 versions
            which unconditionally would follow to all protocols supported. 
            See also <strong><code>CURLOPT_PROTOCOLS</code></strong> for protocol constant values.
           </td>
           <td style="vertical-align: top;">
            Added in cURL 7.19.4.
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_RESUME_FROM</code></strong></td>
           <td style="vertical-align: top;">
            The offset, in bytes, to resume a transfer from.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_SSL_VERIFYHOST</code></strong></td>
           <td style="vertical-align: top;">
            1 to check the existence of a common name in the
            SSL peer certificate. 2 to check the existence of
            a common name and also verify that it matches the hostname
            provided. In production environments the value of this option
            should be kept at 2 (default value).
           </td>
           <td style="vertical-align: top;">
            Support for value 1 removed in cURL 7.28.1
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_SSLVERSION</code></strong></td>
           <td style="vertical-align: top;">
            The SSL version (2 or 3) to use. By default PHP will try to determine
            this itself, although in some cases this must be set manually.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_TIMECONDITION</code></strong></td>
           <td style="vertical-align: top;">
            How <strong><code>CURLOPT_TIMEVALUE</code></strong> is treated.
            Use <em><code class="parameter">CURL_TIMECOND_IFMODSINCE</code></em> to return the
            page only if it has been modified since the time specified in
            <strong><code>CURLOPT_TIMEVALUE</code></strong>. If it hasn&#039;t been modified,
            a <em>&quot;304 Not Modified&quot;</em> header will be returned
            assuming <strong><code>CURLOPT_HEADER</code></strong> is <strong><code>TRUE</code></strong>.
            Use <em><code class="parameter">CURL_TIMECOND_IFUNMODSINCE</code></em> for the reverse
            effect. <em><code class="parameter">CURL_TIMECOND_IFMODSINCE</code></em> is the
            default.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_TIMEOUT</code></strong></td>
           <td style="vertical-align: top;">
            The maximum number of seconds to allow cURL functions to execute.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_TIMEOUT_MS</code></strong></td>
           <td style="vertical-align: top;">
            The maximum number of milliseconds to allow cURL functions to
            execute.
            
            If libcurl is built to use the standard system name resolver, that
            portion of the connect will still use full-second resolution for
            timeouts with a minimum timeout allowed of one second.
           </td>
           <td style="vertical-align: top;">
            Added in cURL 7.16.2. Available since PHP 5.2.3.
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_TIMEVALUE</code></strong></td>
           <td style="vertical-align: top;">
            The time in seconds since January 1st, 1970. The time will be used
            by <strong><code>CURLOPT_TIMECONDITION</code></strong>. By default,
            <em><code class="parameter">CURL_TIMECOND_IFMODSINCE</code></em> is used.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_MAX_RECV_SPEED_LARGE</code></strong></td>
           <td style="vertical-align: top;">
            If a download exceeds this speed (counted in bytes per second) on
            cumulative average during the transfer, the transfer will pause to
            keep the average rate less than or equal to the parameter value.
            Defaults to unlimited speed.
           </td>
           <td style="vertical-align: top;">
            Added in cURL 7.15.5. Available since PHP 5.4.0.
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_MAX_SEND_SPEED_LARGE</code></strong></td>
           <td style="vertical-align: top;">
            If an upload exceeds this speed (counted in bytes per second) on
            cumulative average during the transfer, the transfer will pause to
            keep the average rate less than or equal to the parameter value.
            Defaults to unlimited speed.
           </td>
           <td style="vertical-align: top;">
            Added in cURL 7.15.5. Available since PHP 5.4.0.
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_SSH_AUTH_TYPES</code></strong></td>
           <td style="vertical-align: top;">
            A bitmask consisting of one or more of 
            <strong><code>CURLSSH_AUTH_PUBLICKEY</code></strong>, 
            <strong><code>CURLSSH_AUTH_PASSWORD</code></strong>, 
            <strong><code>CURLSSH_AUTH_HOST</code></strong>, 
            <strong><code>CURLSSH_AUTH_KEYBOARD</code></strong>. Set to 
            <strong><code>CURLSSH_AUTH_ANY</code></strong> to let libcurl pick one.
           </td>
           <td style="vertical-align: top;">
            Added in cURL 7.16.1. 
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_IPRESOLVE</code></strong></td>
           <td style="vertical-align: top;">
            Allows an application to select what kind of IP addresses to use when
            resolving host names. This is only interesting when using host names that
            resolve addresses using more than one version of IP, possible values are
            <strong><code>CURL_IPRESOLVE_WHATEVER</code></strong>, 
            <strong><code>CURL_IPRESOLVE_V4</code></strong>, 
            <strong><code>CURL_IPRESOLVE_V6</code></strong>, by default
            <strong><code>CURL_IPRESOLVE_WHATEVER</code></strong>.
           </td>
           <td style="vertical-align: top;">
            Added in cURL 7.10.8.
           </td>
          </tr>

         </tbody>
        
       </table>

      </p>
      <p class="para">
       <em><code class="parameter">value</code></em> should be a <span class="type"><a href="language.types.string.html" class="type string">string</a></span> for the
       following values of the <em><code class="parameter">option</code></em> parameter:
       <table class="doctable informaltable">
        
         <thead>
          <tr>
           <th>Option</th>
           <th>Set <em><code class="parameter">value</code></em> to</th>
           <th>Notes</th>
          </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_CAINFO</code></strong></td>
           <td style="vertical-align: top;">
            The name of a file holding one or more certificates to verify the
            peer with. This only makes sense when used in combination with
            <strong><code>CURLOPT_SSL_VERIFYPEER</code></strong>.
           </td>
           <td style="vertical-align: top;">
            Requires absolute path.
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_CAPATH</code></strong></td>
           <td style="vertical-align: top;">
            A directory that holds multiple CA certificates. Use this option
            alongside <strong><code>CURLOPT_SSL_VERIFYPEER</code></strong>.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_COOKIE</code></strong></td>
           <td style="vertical-align: top;">
            The contents of the <em>&quot;Cookie: &quot;</em> header to be
            used in the HTTP request.
            Note that multiple cookies are separated with a semicolon followed
            by a space (e.g., &quot;<em>fruit=apple; colour=red</em>&quot;)
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_COOKIEFILE</code></strong></td>
           <td style="vertical-align: top;">
            The name of the file containing the cookie data. The cookie file can
            be in Netscape format, or just plain HTTP-style headers dumped into
            a file.
            If the name is an empty string, no cookies are loaded, but cookie
            handling is still enabled.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_COOKIEJAR</code></strong></td>
           <td style="vertical-align: top;">
            The name of a file to save all internal cookies to when the handle is closed, 
            e.g. after a call to curl_close.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_CUSTOMREQUEST</code></strong></td>
           <td style="vertical-align: top;"><p class="para">
            A custom request method to use instead of
            <em>&quot;GET&quot;</em> or <em>&quot;HEAD&quot;</em> when doing
            a HTTP request. This is useful for doing
            <em>&quot;DELETE&quot;</em> or other, more obscure HTTP requests.
            Valid values are things like <em>&quot;GET&quot;</em>,
            <em>&quot;POST&quot;</em>, <em>&quot;CONNECT&quot;</em> and so on;
            i.e. Do not enter a whole HTTP request line here. For instance,
            entering <em>&quot;GET /index.html HTTP/1.0\r\n\r\n&quot;</em>
            would be incorrect.
            <blockquote class="note"><p><strong class="note">Note</strong>: 
             <p class="para">
              Don&#039;t do this without making sure the server supports the custom
              request method first.
             </p>
            </p></blockquote>
            </p></td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_EGDSOCKET</code></strong></td>
           <td style="vertical-align: top;">
            Like <strong><code>CURLOPT_RANDOM_FILE</code></strong>, except a filename
            to an Entropy Gathering Daemon socket.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_ENCODING</code></strong></td>
           <td style="vertical-align: top;">
            The contents of the <em>&quot;Accept-Encoding: &quot;</em> header.
            This enables decoding of the response. Supported encodings are
            <em>&quot;identity&quot;</em>, <em>&quot;deflate&quot;</em>, and
            <em>&quot;gzip&quot;</em>. If an empty string, <em>&quot;&quot;</em>,
            is set, a header containing all supported encoding types is sent.
           </td>
           <td style="vertical-align: top;">
            Added in cURL 7.10.
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_FTPPORT</code></strong></td>
           <td style="vertical-align: top;">
            The value which will be used to get the IP address to use
            for the FTP &quot;PORT&quot; instruction. The &quot;PORT&quot; instruction tells
            the remote server to connect to our specified IP address.  The
            string may be a plain IP address, a hostname, a network
            interface name (under Unix), or just a plain &#039;-&#039; to use the
            systems default IP address.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_INTERFACE</code></strong></td>
           <td style="vertical-align: top;">
            The name of the outgoing network interface to use. This can be an
            interface name, an IP address or a host name.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_KEYPASSWD</code></strong></td>
           <td style="vertical-align: top;">
            The password required to use the <strong><code>CURLOPT_SSLKEY</code></strong> 
            or <strong><code>CURLOPT_SSH_PRIVATE_KEYFILE</code></strong> private key. 
           </td>
           <td style="vertical-align: top;">
            Added in cURL 7.16.1. 
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_KRB4LEVEL</code></strong></td>
           <td style="vertical-align: top;">
            The KRB4 (Kerberos 4) security level. Any of the following values
            (in order from least to most powerful) are valid:
            <em>&quot;clear&quot;</em>,
            <em>&quot;safe&quot;</em>,
            <em>&quot;confidential&quot;</em>,
            <em>&quot;private&quot;.</em>.
            If the string does not match one of these,
            <em>&quot;private&quot;</em> is used. Setting this option to <strong><code>NULL</code></strong>
            will disable KRB4 security. Currently KRB4 security only works
            with FTP transactions.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_POSTFIELDS</code></strong></td>
           <td style="vertical-align: top;">
            <span class="simpara">
             The full data to post in a HTTP &quot;POST&quot; operation.
             To post a file, prepend a filename with <em>@</em> and
             use the full path. The filetype can be explicitly specified by
             following the filename with the type in the format
             &#039;<em>;type=mimetype</em>&#039;. This parameter can either be
             passed as a urlencoded string like &#039;<em>para1=val1&amp;para2=val2&amp;...</em>&#039; 
             or as an array with the field name as key and field data as value.
             If <em><code class="parameter">value</code></em> is an array, the
             <em>Content-Type</em> header will be set to
             <em>multipart/form-data</em>.
            </span>
            <span class="simpara">
             As of PHP 5.2.0, <em><code class="parameter">value</code></em> must be an array if
             files are passed to this option with the <em>@</em> prefix.
            </span>
            <span class="simpara">
             As of PHP 5.5.0, the <em>@</em> prefix is deprecated and
             files can be sent using <a href="class.curlfile.html" class="classname">CURLFile</a>.
            </span>
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_PROXY</code></strong></td>
           <td style="vertical-align: top;">
            The HTTP proxy to tunnel requests through.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_PROXYUSERPWD</code></strong></td>
           <td style="vertical-align: top;">
            A username and password formatted as
            <em>&quot;[username]:[password]&quot;</em> to use for the
            connection to the proxy.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_RANDOM_FILE</code></strong></td>
           <td style="vertical-align: top;">
            A filename to be used to seed the random number generator for SSL.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_RANGE</code></strong></td>
           <td style="vertical-align: top;">
            Range(s) of data to retrieve in the format
            <em>&quot;X-Y&quot;</em> where X or Y are optional. HTTP transfers
            also support several intervals, separated with commas in the format
            <em>&quot;X-Y,N-M&quot;</em>.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_REFERER</code></strong></td>
           <td style="vertical-align: top;">
            The contents of the <em>&quot;Referer: &quot;</em> header to be used
            in a HTTP request.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_SSH_HOST_PUBLIC_KEY_MD5</code></strong></td>
           <td style="vertical-align: top;">
            A string containing 32 hexadecimal digits. The string should be the 
            MD5 checksum of the remote host&#039;s public key, and libcurl will reject 
            the connection to the host unless the md5sums match. 
            This option is only for SCP and SFTP transfers.
           </td>
           <td style="vertical-align: top;">
            Added in cURL 7.17.1. 
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_SSH_PUBLIC_KEYFILE</code></strong></td>
           <td style="vertical-align: top;">
            The file name for your public key. If not used, libcurl defaults to 
            $HOME/.ssh/id_dsa.pub if the HOME environment variable is set, 
            and just &quot;id_dsa.pub&quot; in the current directory if HOME is not set.
           </td>
           <td style="vertical-align: top;">
            Added in cURL 7.16.1. 
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_SSH_PRIVATE_KEYFILE</code></strong></td>
           <td style="vertical-align: top;">
            The file name for your private key. If not used, libcurl defaults to 
            $HOME/.ssh/id_dsa if the HOME environment variable is set, 
            and just &quot;id_dsa&quot; in the current directory if HOME is not set. 
            If the file is password-protected, set the password with 
            <strong><code>CURLOPT_KEYPASSWD</code></strong>.
           </td>
           <td style="vertical-align: top;">
            Added in cURL 7.16.1. 
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_SSL_CIPHER_LIST</code></strong></td>
           <td style="vertical-align: top;">
            A list of ciphers to use for SSL. For example,
            <em>RC4-SHA</em> and <em>TLSv1</em> are valid
            cipher lists.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_SSLCERT</code></strong></td>
           <td style="vertical-align: top;">
            The name of a file containing a PEM formatted certificate.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_SSLCERTPASSWD</code></strong></td>
           <td style="vertical-align: top;">
            The password required to use the
            <strong><code>CURLOPT_SSLCERT</code></strong> certificate.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_SSLCERTTYPE</code></strong></td>
           <td style="vertical-align: top;">
            The format of the certificate. Supported formats are
            <em>&quot;PEM&quot;</em> (default), <em>&quot;DER&quot;</em>,
            and <em>&quot;ENG&quot;</em>.
           </td>
           <td style="vertical-align: top;">
            Added in cURL 7.9.3.
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_SSLENGINE</code></strong></td>
           <td style="vertical-align: top;">
            The identifier for the crypto engine of the private SSL key
            specified in <strong><code>CURLOPT_SSLKEY</code></strong>.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_SSLENGINE_DEFAULT</code></strong></td>
           <td style="vertical-align: top;">
            The identifier for the crypto engine used for asymmetric crypto
            operations.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_SSLKEY</code></strong></td>
           <td style="vertical-align: top;">
            The name of a file containing a private SSL key.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_SSLKEYPASSWD</code></strong></td>
           <td style="vertical-align: top;"><p class="para">
            The secret password needed to use the private SSL key specified in
            <strong><code>CURLOPT_SSLKEY</code></strong>.
            <blockquote class="note"><p><strong class="note">Note</strong>: 
             <p class="para">
              Since this option contains a sensitive password, remember to keep
              the PHP script it is contained within safe.
             </p>
            </p></blockquote>
            </p></td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_SSLKEYTYPE</code></strong></td>
           <td style="vertical-align: top;">
            The key type of the private SSL key specified in
            <strong><code>CURLOPT_SSLKEY</code></strong>. Supported key types are
            <em>&quot;PEM&quot;</em> (default), <em>&quot;DER&quot;</em>,
            and <em>&quot;ENG&quot;</em>.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_URL</code></strong></td>
           <td style="vertical-align: top;">
            The URL to fetch. This can also be set when initializing a
            session with  <span class="function"><a href="function.curl-init.html" class="function">curl_init()</a></span>.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_USERAGENT</code></strong></td>
           <td style="vertical-align: top;">
            The contents of the <em>&quot;User-Agent: &quot;</em> header to be
            used in a HTTP request.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_USERPWD</code></strong></td>
           <td style="vertical-align: top;">
            A username and password formatted as
            <em>&quot;[username]:[password]&quot;</em> to use for the
            connection.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

         </tbody>
        
       </table>

      </p>
      <p class="para">
       <em><code class="parameter">value</code></em> should be an array for the
       following values of the <em><code class="parameter">option</code></em> parameter:
       <table class="doctable informaltable">
        
         <thead>
          <tr>
           <th>Option</th>
           <th>Set <em><code class="parameter">value</code></em> to</th>
           <th>Notes</th>
          </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_HTTP200ALIASES</code></strong></td>
           <td style="vertical-align: top;">
            An array of HTTP 200 responses that will be treated as valid
            responses and not as errors.
           </td>
           <td style="vertical-align: top;">
            Added in cURL 7.10.3.
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_HTTPHEADER</code></strong></td>
           <td style="vertical-align: top;">
            An array of HTTP header fields to set, in the format
            <code class="code">
             array(&#039;Content-type: text/plain&#039;, &#039;Content-length: 100&#039;)
            </code>
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_POSTQUOTE</code></strong></td>
           <td style="vertical-align: top;">
            An array of FTP commands to execute on the server after the FTP
            request has been performed.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_QUOTE</code></strong></td>
           <td style="vertical-align: top;">
            An array of FTP commands to execute on the server prior to the FTP
            request.
           </td>
           <td style="vertical-align: top;">
           </td>
          </tr>

         </tbody>
        
       </table>

      </p>
      <p class="para">
       <em><code class="parameter">value</code></em> should be a stream resource (using
        <span class="function"><a href="function.fopen.html" class="function">fopen()</a></span>, for example) for the following values of the
       <em><code class="parameter">option</code></em> parameter:
       <table class="doctable informaltable">
        
         <thead>
          <tr>
           <th>Option</th>
           <th>Set <em><code class="parameter">value</code></em> to</th>
          </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_FILE</code></strong></td>
           <td style="vertical-align: top;">
            The file that the transfer should be written to. The default
            is <em>STDOUT</em> (the browser window).
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_INFILE</code></strong></td>
           <td style="vertical-align: top;">
            The file that the transfer should be read from when uploading.
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_STDERR</code></strong></td>
           <td style="vertical-align: top;">
            An alternative location to output errors to instead of
            <em>STDERR</em>.
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_WRITEHEADER</code></strong></td>
           <td style="vertical-align: top;">
            The file that the header part of the transfer is written to.
           </td>
          </tr>

         </tbody>
        
       </table>

      </p>
      <p class="para">
       <em><code class="parameter">value</code></em> should be the name of a valid function or a Closure 
       for the following values of the <em><code class="parameter">option</code></em> parameter:
       <table class="doctable informaltable">
        
         <thead>
          <tr>
           <th>Option</th>
           <th>Set <em><code class="parameter">value</code></em> to</th>
          </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_HEADERFUNCTION</code></strong></td>
           <td style="vertical-align: top;">
            A callback accepting two parameters.
            The first is the cURL resource, the second is a
            string with the header data to be written. The header data must
            be written when by this callback. Return the number of 
            bytes written.
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_PASSWDFUNCTION</code></strong></td>
           <td style="vertical-align: top;">
            A callback accepting three parameters. 
            The first is the cURL resource, the second is a
            string containing a password prompt, and the third is the maximum
            password length. Return the string containing the password.
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_PROGRESSFUNCTION</code></strong></td>
           <td style="vertical-align: top;">
            <p class="para">
             A callback accepting five parameters.
             The first is the cURL resource, the second is the total number of
             bytes expected to be downloaded in this transfer, the third is
             the number of bytes downloaded so far, the fourth is the total
             number of bytes expected to be uploaded in this transfer, and the
             fifth is the number of bytes uploaded so far.
            </p>
            <blockquote class="note"><p><strong class="note">Note</strong>: 
             <p class="para">
              The callback is only called when the <strong><code>CURLOPT_NOPROGRESS</code></strong>
              option is set to <strong><code>FALSE</code></strong>.
             </p>
            </p></blockquote>
            <p class="para">
             Return a non-zero value to abort the transfer. In which case, the
             transfer will set a <strong><code>CURLE_ABORTED_BY_CALLBACK</code></strong>
             error.
            </p>
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_READFUNCTION</code></strong></td>
           <td style="vertical-align: top;">
            A callback accepting three parameters. 
            The first is the cURL resource, the second is a
            stream resource provided to cURL through the option
            <strong><code>CURLOPT_INFILE</code></strong>, and the third is the maximum
            amount of data to be read. The callback must return a string
            with a length equal or smaller than the amount of data requested,
            typically by reading it from the passed stream resource. It should
            return an empty string to signal <em>EOF</em>.
           </td>
          </tr>

          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_WRITEFUNCTION</code></strong></td>
           <td style="vertical-align: top;">
            A callback accepting two parameters. 
            The first is the cURL resource, and the second is a
            string with the data to be written. The data must be saved by
            this callback. It must return the exact number of bytes written 
            or the transfer will be aborted with an error.
           </td>
          </tr>

         </tbody>
        
       </table>

      </p>
      <p class="para">
       Other values:
       <table class="doctable informaltable">
        
         <thead>
          <tr>
           <th>Option</th>
           <th>Set <em><code class="parameter">value</code></em> to</th>
          </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td style="vertical-align: top;"><strong><code>CURLOPT_SHARE</code></strong></td>
           <td style="vertical-align: top;">
            A result of  <span class="function"><a href="function.curl-share-init.html" class="function">curl_share_init()</a></span>. Makes the cURL
            handle to use the data from the shared handle.
           </td>
          </tr>

         </tbody>
        
       </table>

      </p>
     </dd>

    </dt>

   </dl>

  </p>
 </div>

 
 <div class="refsect1 returnvalues" id="refsect1-function.curl-setopt-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns <strong><code>TRUE</code></strong> on success or <strong><code>FALSE</code></strong> on failure.
  </p>
 </div>

 
 <div class="refsect1 changelog" id="refsect1-function.curl-setopt-changelog">
  <h3 class="title">Changelog</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>5.5.0</td>
       <td>
        Added the cURL resource as the first argument to the
        <strong><code>CURLOPT_PROGRESSFUNCTION</code></strong> callback.
       </td>
      </tr>

      <tr>
       <td>5.5.0</td>
       <td>
        Introduced <strong><code>CURLOPT_SHARE</code></strong>.
       </td>
      </tr>

      <tr>
       <td>5.3.0</td>
       <td>
        Introduced <strong><code>CURLOPT_PROGRESSFUNCTION</code></strong>.
       </td>
      </tr>

      <tr>
       <td>5.2.10</td>
       <td>
        Introduced <strong><code>CURLOPT_PROTOCOLS</code></strong>, and
        <strong><code>CURLOPT_REDIR_PROTOCOLS</code></strong>.
       </td>
      </tr>

      <tr>
       <td>5.1.0</td>
       <td>
        Introduced <strong><code>CURLOPT_AUTOREFERER</code></strong>,
        <strong><code>CURLOPT_BINARYTRANSFER</code></strong>,
        <strong><code>CURLOPT_FTPSSLAUTH</code></strong>,
        <strong><code>CURLOPT_PROXYAUTH</code></strong>, and
        <strong><code>CURLOPT_TIMECONDITION</code></strong>.
       </td>
      </tr>

      <tr>
       <td>5.0.0</td>
       <td>
        Introduced <strong><code>CURLOPT_FTP_USE_EPRT</code></strong>,
        <strong><code>CURLOPT_NOSIGNAL</code></strong>,
        <strong><code>CURLOPT_UNRESTRICTED_AUTH</code></strong>,
        <strong><code>CURLOPT_BUFFERSIZE</code></strong>,
        <strong><code>CURLOPT_HTTPAUTH</code></strong>,
        <strong><code>CURLOPT_PROXYPORT</code></strong>,
        <strong><code>CURLOPT_PROXYTYPE</code></strong>,
        <strong><code>CURLOPT_SSLCERTTYPE</code></strong>, and
        <strong><code>CURLOPT_HTTP200ALIASES</code></strong>.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>

 
 <div class="refsect1 examples" id="refsect1-function.curl-setopt-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-4225">
    <p><strong>Example #1 Initializing a new cURL session and fetching a web page</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//&nbsp;create&nbsp;a&nbsp;new&nbsp;cURL&nbsp;resource<br /></span><span style="color: #0000BB">$ch&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">curl_init</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">//&nbsp;set&nbsp;URL&nbsp;and&nbsp;other&nbsp;appropriate&nbsp;options<br /></span><span style="color: #0000BB">curl_setopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">CURLOPT_URL</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"http://www.example.com/"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">curl_setopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">CURLOPT_HEADER</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;grab&nbsp;URL&nbsp;and&nbsp;pass&nbsp;it&nbsp;to&nbsp;the&nbsp;browser<br /></span><span style="color: #0000BB">curl_exec</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;close&nbsp;cURL&nbsp;resource,&nbsp;and&nbsp;free&nbsp;up&nbsp;system&nbsp;resources<br /></span><span style="color: #0000BB">curl_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
  <p class="para">
   <div class="example" id="example-4226">
    <p><strong>Example #2 Uploading file</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">/*&nbsp;http://localhost/upload.php:<br />print_r($_POST);<br />print_r($_FILES);<br />*/<br /><br /></span><span style="color: #0000BB">$ch&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">curl_init</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">$data&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #DD0000">'name'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'Foo'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'file'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'@/home/user/test.png'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">curl_setopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">CURLOPT_URL</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'http://localhost/upload.php'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">curl_setopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">CURLOPT_POST</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">curl_setopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">CURLOPT_POSTFIELDS</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$data</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">curl_exec</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>The above example will output:</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Array
(
    [name] =&gt; Foo
)
Array
(
    [file] =&gt; Array
        (
            [name] =&gt; test.png
            [type] =&gt; image/png
            [tmp_name] =&gt; /tmp/phpcpjNeQ
            [error] =&gt; 0
            [size] =&gt; 279
        )

)

</pre></div>
    </div>
   </div>
  </p>
 </div>

 
 <div class="refsect1 notes" id="refsect1-function.curl-setopt-notes">
  <h3 class="title">Notes</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    Passing an array to <strong><code>CURLOPT_POSTFIELDS</code></strong> will 
    encode the data as <em class="emphasis">multipart/form-data</em>,
    while passing a URL-encoded string will encode the data as
    <em class="emphasis">application/x-www-form-urlencoded</em>.
   </p>
  </p></blockquote>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-function.curl-setopt-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"> <span class="function"><a href="function.curl-setopt-array.html" class="function" rel="rdfs-seeAlso">curl_setopt_array()</a> - Set multiple options for a cURL transfer</span></li>
   </ul>
  </p>
 </div>

 
</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.curl-setopt-array.html">curl_setopt_array</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.curl-share-close.html">curl_share_close</a></div>
 <div class="up"><a href="ref.curl.html">cURL Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>