The constants below are defined by this extension, and
will only be available when the extension has either
been compiled into PHP or dynamically loaded at runtime.
Constants |
Description |
curl_getinfo()
CURLINFO_APPCONNECT_TIME
(int)
|
Time in seconds it took from the start until the SSL/SSH connect/handshake to the remote host was completed
|
CURLINFO_APPCONNECT_TIME_T
(int)
|
Time, in microseconds, it took from the start until the SSL/SSH connect/handshake to the remote host was completed.
Available as of PHP 7.3.0 and cURL 7.61.0
|
CURLINFO_CAINFO
(int)
|
Default built-in CA certificate path.
Available as of PHP 8.3.0 and cURL 7.84.0
|
CURLINFO_CAPATH
(int)
|
Default built-in CA path string.
Available as of PHP 8.3.0 and cURL 7.84.0
|
CURLINFO_CERTINFO
(int)
|
TLS certificate chain
|
CURLINFO_CONDITION_UNMET
(int)
|
Info on unmet time conditional
|
CURLINFO_CONNECT_TIME
(int)
|
Time in seconds it took to establish the connection
|
CURLINFO_CONNECT_TIME_T
(int)
|
Total time taken, in microseconds, from the start until the connection to the remote host (or proxy) was completed.
Available as of PHP 7.3.0 and cURL 7.61.0
|
CURLINFO_CONTENT_LENGTH_DOWNLOAD
(int)
|
Content length of download, read from Content-Length: field
|
CURLINFO_CONTENT_LENGTH_DOWNLOAD_T
(int)
|
The content-length of the download. This is the value read from the Content-Length: field. -1 if the size isn't known.
Available as of PHP 7.3.0 and cURL 7.55.0
|
CURLINFO_CONTENT_LENGTH_UPLOAD
(int)
|
Specified size of upload
|
CURLINFO_CONTENT_LENGTH_UPLOAD_T
(int)
|
The specified size of the upload. -1 if the size isn't known.
Available as of PHP 7.3.0 and cURL 7.55.0
|
CURLINFO_CONTENT_TYPE
(int)
|
Content-Type: of the requested document. NULL indicates server did not send valid Content-Type: header
|
CURLINFO_COOKIELIST
(int)
|
All known cookies
|
CURLINFO_EFFECTIVE_METHOD
(int)
|
Get the last used HTTP method.
|
CURLINFO_EFFECTIVE_URL
(int)
|
Last effective URL
|
CURLINFO_FILETIME
(int)
|
Remote time of the retrieved document, with the CURLOPT_FILETIME enabled; if -1 is returned the time of the document is unknown
|
CURLINFO_FILETIME_T
(int)
|
Remote time of the retrieved document (as Unix timestamp), an alternative to CURLINFO_FILETIME to allow systems with 32 bit long variables to extract dates outside of the 32bit timestamp range.
Available as of PHP 7.3.0 and cURL 7.59.0
|
CURLINFO_FTP_ENTRY_PATH
(int)
|
Entry path in FTP server
|
The request string sent. For this to work, add the CURLINFO_HEADER_OUT option to the handle by calling curl_setopt()
|
Total size of all headers received
|
CURLINFO_HTTPAUTH_AVAIL
(int)
|
Bitmask indicating the authentication method(s) available according to the previous response
|
CURLINFO_HTTP_CODE
(int)
|
The last response code.
As of cURL 7.10.8, this is a legacy alias of CURLINFO_RESPONSE_CODE .
|
CURLINFO_HTTP_CONNECTCODE
(int)
|
The CONNECT response code
|
CURLINFO_HTTP_VERSION
(int)
|
The version used in the last HTTP connection. The return value will be one of the defined CURL_HTTP_VERSION_* constants or 0 if the version can't be determined.
Available as of PHP 7.3.0 and cURL 7.50.0
|
CURLINFO_LASTONE
(int)
|
The last enum value in the underlying CURLINFO enum
in libcurl .
|
CURLINFO_LOCAL_IP
(int)
|
Local (source) IP address of the most recent connection
|
CURLINFO_LOCAL_PORT
(int)
|
Local (source) port of the most recent connection
|
CURLINFO_NAMELOOKUP_TIME
(int)
|
Time in seconds until name resolving was complete
|
CURLINFO_NAMELOOKUP_TIME_T
(int)
|
Time in microseconds from the start until the name resolving was completed.
Available as of PHP 7.3.0 and cURL 7.61.0
|
CURLINFO_NUM_CONNECTS
(int)
|
Number of connections curl had to create to achieve the previous transfer
|
CURLINFO_OS_ERRNO
(int)
|
Errno from a connect failure. The number is OS and system specific.
|
CURLINFO_PRETRANSFER_TIME
(int)
|
Time in seconds from start until just before file transfer begins
|
CURLINFO_PRETRANSFER_TIME_T
(int)
|
Time taken from the start until the file transfer is just about to begin, in microseconds.
Available as of PHP 7.3.0 and cURL 7.61.0
|
CURLINFO_PRIMARY_IP
(int)
|
IP address of the most recent connection
|
CURLINFO_PRIMARY_PORT
(int)
|
Destination port of the most recent connection
|
CURLINFO_PRIVATE
(int)
|
Private data associated with this cURL handle, previously set with the CURLOPT_PRIVATE option of curl_setopt()
|
CURLINFO_PROTOCOL
(int)
|
The protocol used in the last HTTP connection. The returned value will be exactly one of the CURLPROTO_* values.
Available as of PHP 7.3.0 and cURL 7.52.0
|
CURLINFO_PROXYAUTH_AVAIL
(int)
|
Bitmask indicating the proxy authentication method(s) available according to the previous response
|
CURLINFO_PROXY_ERROR
(int)
|
The detailed (SOCKS) proxy error code when the most recent transfer returned a CURLE_PROXY error. The returned value will be exactly one of the CURLPX_* values. The error code will be CURLPX_OK if no response code was available.
Available as of PHP 8.2.0 and cURL 7.73.0
|
CURLINFO_PROXY_SSL_VERIFYRESULT
(int)
|
The result of the certificate verification that was requested (using the CURLOPT_PROXY_SSL_VERIFYPEER option). Only used for HTTPS proxies.
Available as of PHP 7.3.0 and cURL 7.52.0
|
CURLINFO_REDIRECT_COUNT
(int)
|
Number of redirects, with the CURLOPT_FOLLOWLOCATION option enabled
|
CURLINFO_REDIRECT_TIME
(int)
|
Time in seconds of all redirection steps before final transaction was started, with the CURLOPT_FOLLOWLOCATION option enabled
|
CURLINFO_REDIRECT_TIME_T
(int)
|
Total time, in microseconds, it took for all redirection steps include name lookup, connect, pretransfer and transfer before final transaction was started.
Available as of PHP 7.3.0 and cURL 7.61.0
|
CURLINFO_REDIRECT_URL
(int)
|
With the CURLOPT_FOLLOWLOCATION option disabled: redirect URL found in the last transaction, that should be requested manually next. With the CURLOPT_FOLLOWLOCATION option enabled: this is empty. The redirect URL in this case is available in CURLINFO_EFFECTIVE_URL
|
CURLINFO_REFERER
(int)
|
The referrer header.
Available as of PHP 8.2.0 and cURL 7.76.0
|
CURLINFO_REQUEST_SIZE
(int)
|
Total size of issued requests, currently only for HTTP requests
|
CURLINFO_RESPONSE_CODE
(int)
|
The last response code.
Available as of cURL 7.10.8
|
CURLINFO_RETRY_AFTER
(int)
|
The information from the Retry-After: header, or zero if there was no valid header.
Available as of PHP 8.2.0 and cURL 7.66.0
|
CURLINFO_RTSP_CLIENT_CSEQ
(int)
|
Next RTSP client CSeq
|
CURLINFO_RTSP_CSEQ_RECV
(int)
|
Recently received CSeq
|
CURLINFO_RTSP_SERVER_CSEQ
(int)
|
Next RTSP server CSeq
|
CURLINFO_RTSP_SESSION_ID
(int)
|
RTSP session ID
|
CURLINFO_SCHEME
(int)
|
The URL scheme used for the most recent connection.
Available as of PHP 7.3.0 and cURL 7.52.0
|
CURLINFO_SIZE_DOWNLOAD
(int)
|
Total number of bytes downloaded
|
CURLINFO_SIZE_DOWNLOAD_T
(int)
|
Total number of bytes that were downloaded. The number is only for the latest transfer and will be reset again for each new transfer.
Available as of PHP 7.3.0 and cURL 7.50.0
|
CURLINFO_SIZE_UPLOAD
(int)
|
Total number of bytes uploaded
|
CURLINFO_SIZE_UPLOAD_T
(int)
|
Total number of bytes that were uploaded.
Available as of PHP 7.3.0 and cURL 7.50.0
|
CURLINFO_SPEED_DOWNLOAD
(int)
|
Average download speed
|
CURLINFO_SPEED_DOWNLOAD_T
(int)
|
The average download speed in bytes/second that curl measured for the complete download.
Available as of PHP 7.3.0 and cURL 7.50.0
|
CURLINFO_SPEED_UPLOAD
(int)
|
Average upload speed
|
CURLINFO_SPEED_UPLOAD_T
(int)
|
The average upload speed in bytes/second that curl measured for the complete upload.
Available as of PHP 7.3.0 and cURL 7.50.0
|
CURLINFO_SSL_ENGINES
(int)
|
OpenSSL crypto-engines supported
|
CURLINFO_SSL_VERIFYRESULT
(int)
|
Result of SSL certification verification requested by setting CURLOPT_SSL_VERIFYPEER
|
CURLINFO_STARTTRANSFER_TIME
(int)
|
Time in seconds until the first byte is about to be transferred
|
CURLINFO_STARTTRANSFER_TIME_T
(int)
|
Time, in microseconds, it took from the start until the first byte is received.
Available as of PHP 7.3.0 and cURL 7.61.0
|
CURLINFO_TOTAL_TIME
(int)
|
Total transaction time in seconds for last transfer
|
CURLINFO_TOTAL_TIME_T
(int)
|
Total time in microseconds for the previous transfer, including name resolving, TCP connect etc.
Available as of PHP 7.3.0 and cURL 7.61.0
|
Constants |
Description |
curl_multi_setopt()
CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE
(int)
|
Specifies the chunk length threshold for pipelining in bytes.
Available as of PHP 7.0.7 and cURL 7.30.0
|
CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE
(int)
|
Specifies the size threshold for pipelining penalty in bytes.
Available as of PHP 7.0.7 and cURL 7.30.0
|
CURLMOPT_MAXCONNECTS
(int)
|
Specifies the maximum amount of simultaneously open connections
that libcurl may cache.
By default the size will be enlarged to fit four times the number
of handles added via curl_multi_add_handle().
When the cache is full, curl closes the oldest one in the cache
to prevent the number of open connections from increasing.
Available as of cURL 7.16.3.
|
CURLMOPT_MAX_CONCURRENT_STREAMS
(int)
|
Specifies the maximum number of concurrent streams for connections
that cURL should support on connections using HTTP/2.
Valid values range from 1
to 2147483647 (2^31 - 1 ).
The value passed here would be honored
based on other system resources properties.
Default is 100 .
Available as of PHP 8.2.0 and cURL 7.67.0.
|
CURLMOPT_MAX_HOST_CONNECTIONS
(int)
|
Specifies the maximum number of connections to a single host.
Available as of PHP 7.0.7 and cURL 7.30.0
|
CURLMOPT_MAX_PIPELINE_LENGTH
(int)
|
Specifies the maximum number of requests in a pipeline.
Available as of PHP 7.0.7 and cURL 7.30.0
|
CURLMOPT_MAX_TOTAL_CONNECTIONS
(int)
|
Specifies the maximum number of simultaneously open connections.
Available as of PHP 7.0.7 and cURL 7.30.0
|
CURLMOPT_PIPELINING
(int)
|
Pass 1 to enable or 0 to disable. Enabling pipelining on a multi
handle will make it attempt to perform HTTP Pipelining as far as
possible for transfers using this handle. This means that adding
a second request that can use an already existing connection will "pipe"
the second request on the same connection.
As of cURL 7.43.0, the value is a bitmask,
and passing 2 will try to multiplex the new
transfer over an existing HTTP/2 connection.
Passing 3 instructs cURL to ask for pipelining and multiplexing
independently of each other.
As of cURL 7.62.0, setting the pipelining bit has no effect.
Instead of integer literals, the CURLPIPE_* constants can also be used.
Available as of cURL 7.16.0.
|
CURLMOPT_PUSHFUNCTION
(int)
|
Pass a callable that will be registered to handle server
pushes and should have the following signature:
parent_ch
-
The parent cURL handle (the request the client made).
pushed_ch
-
A new cURL handle for the pushed request.
headers
-
The push promise headers.
The push function is supposed to return either
CURL_PUSH_OK if it can handle the push, or
CURL_PUSH_DENY to reject it.
Available as of PHP 7.1.0 and cURL 7.44.0
|
Constants |
Description |
cURL error constants
CURLE_ABORTED_BY_CALLBACK
(int)
|
Aborted by callback. A callback returned "abort" to libcurl.
|
CURLE_BAD_CALLING_ORDER
(int)
|
|
CURLE_BAD_CONTENT_ENCODING
(int)
|
Unrecognized transfer encoding.
|
CURLE_BAD_DOWNLOAD_RESUME
(int)
|
The download could not be resumed because the specified offset was out of the file boundary.
|
CURLE_BAD_FUNCTION_ARGUMENT
(int)
|
A function was called with a bad parameter.
|
CURLE_BAD_PASSWORD_ENTERED
(int)
|
|
CURLE_COULDNT_CONNECT
(int)
|
Failed to connect to host or proxy.
|
CURLE_COULDNT_RESOLVE_HOST
(int)
|
Could not resolve host. The given remote host was not resolved.
|
CURLE_COULDNT_RESOLVE_PROXY
(int)
|
Could not resolve proxy. The given proxy host could not be resolved.
|
CURLE_FAILED_INIT
(int)
|
Early initialization code failed.
This is likely to be an internal error or problem,
or a resource problem where something fundamental could not get done at init time.
|
CURLE_FILESIZE_EXCEEDED
(int)
|
Maximum file size exceeded.
|
CURLE_FILE_COULDNT_READ_FILE
(int)
|
A file given with FILE:// could not be opened.
Most likely because the file path does not identify an existing file
or due to the lack of appropriate file permissions.
|
CURLE_FTP_ACCESS_DENIED
(int)
|
|
CURLE_FTP_BAD_DOWNLOAD_RESUME
(int)
|
|
CURLE_FTP_CANT_GET_HOST
(int)
|
An internal failure to lookup the host used for the new connection.
|
CURLE_FTP_CANT_RECONNECT
(int)
|
|
CURLE_FTP_COULDNT_GET_SIZE
(int)
|
|
CURLE_FTP_COULDNT_RETR_FILE
(int)
|
This was either a unexpected reply to a 'RETR' command
or a zero byte transfer complete.
|
CURLE_FTP_COULDNT_SET_ASCII
(int)
|
|
CURLE_FTP_COULDNT_SET_BINARY
(int)
|
|
CURLE_FTP_COULDNT_STOR_FILE
(int)
|
|
CURLE_FTP_COULDNT_USE_REST
(int)
|
The FTP REST command returned error.
This should never happen if the server is sane.
|
CURLE_FTP_PARTIAL_FILE
(int)
|
|
CURLE_FTP_PORT_FAILED
(int)
|
The FTP PORT command returned error.
This mostly happens when a good enough address has not been specified for libcurl to use.
See CURLOPT_FTPPORT .
|
CURLE_FTP_QUOTE_ERROR
(int)
|
|
CURLE_FTP_SSL_FAILED
(int)
|
|
CURLE_FTP_USER_PASSWORD_INCORRECT
(int)
|
|
CURLE_FTP_WEIRD_227_FORMAT
(int)
|
FTP servers return a 227-line as a response to a PASV command.
If libcurl fails to parse that line, this return code is passed back.
|
CURLE_FTP_WEIRD_PASS_REPLY
(int)
|
After having sent the FTP password to the server, libcurl expects a proper reply.
This error code indicates that an unexpected code was returned.
|
CURLE_FTP_WEIRD_PASV_REPLY
(int)
|
libcurl failed to get a sensible result back from the server
as a response to either a PASV or a EPSV command. The server is flawed.
|
CURLE_FTP_WEIRD_SERVER_REPLY
(int)
|
The server sent data libcurl could not parse.
This error code is known as CURLE_WEIRD_SERVER_REPLY
as of cURL 7.51.0.
|
CURLE_FTP_WEIRD_USER_REPLY
(int)
|
|
CURLE_FTP_WRITE_ERROR
(int)
|
|
CURLE_FUNCTION_NOT_FOUND
(int)
|
Function not found. A required zlib function was not found.
|
CURLE_GOT_NOTHING
(int)
|
Nothing was returned from the server, and under the circumstances,
getting nothing is considered an error.
|
CURLE_HTTP_NOT_FOUND
(int)
|
|
CURLE_HTTP_PORT_FAILED
(int)
|
|
CURLE_HTTP_POST_ERROR
(int)
|
This is an odd error that mainly occurs due to internal confusion.
|
CURLE_HTTP_RANGE_ERROR
(int)
|
|
CURLE_HTTP_RETURNED_ERROR
(int)
|
This is returned if CURLOPT_FAILONERROR is set true
and the HTTP server returns an error code that is greater than or equal to 400.
|
CURLE_LDAP_CANNOT_BIND
(int)
|
LDAP cannot bind. LDAP bind operation failed.
|
CURLE_LDAP_INVALID_URL
(int)
|
|
CURLE_LDAP_SEARCH_FAILED
(int)
|
LDAP search failed.
|
CURLE_LIBRARY_NOT_FOUND
(int)
|
|
CURLE_MALFORMAT_USER
(int)
|
|
CURLE_OBSOLETE
(int)
|
|
CURLE_OK
(int)
|
All fine. Proceed as usual.
|
CURLE_OPERATION_TIMEDOUT
(int)
|
Operation timeout.
The specified time-out period was reached according to the conditions.
|
CURLE_OPERATION_TIMEOUTED
(int)
|
|
CURLE_OUT_OF_MEMORY
(int)
|
A memory allocation request failed.
|
CURLE_PARTIAL_FILE
(int)
|
A file transfer was shorter or larger than expected.
This happens when the server first reports an expected transfer size,
and then delivers data that does not match the previously given size.
|
CURLE_PROXY
(int)
|
Proxy handshake error.
CURLINFO_PROXY_ERROR provides extra details on the specific problem.
Available as of PHP 8.2.0 and cURL 7.73.0
|
CURLE_READ_ERROR
(int)
|
There was a problem reading a local file or an error returned by the read callback.
|
CURLE_RECV_ERROR
(int)
|
Failure with receiving network data.
|
CURLE_SEND_ERROR
(int)
|
Failed sending network data.
|
CURLE_SHARE_IN_USE
(int)
|
|
CURLE_SSH
(int)
|
An unspecified error occurred during the SSH session.
Available as of cURL 7.16.1.
|
CURLE_SSL_CACERT
(int)
|
|
CURLE_SSL_CACERT_BADFILE
(int)
|
Problem with reading the SSL CA cert.
|
CURLE_SSL_CERTPROBLEM
(int)
|
Problem with the local client certificate.
|
CURLE_SSL_CIPHER
(int)
|
Could not use specified cipher.
|
CURLE_SSL_CONNECT_ERROR
(int)
|
A problem occurred somewhere in the SSL/TLS handshake.
Reading the message in the error buffer provides more details on the problem.
Could be certificates (file formats, paths, permissions), passwords, and others.
|
CURLE_SSL_ENGINE_NOTFOUND
(int)
|
The specified crypto engine was not found.
|
CURLE_SSL_ENGINE_SETFAILED
(int)
|
Failed setting the selected SSL crypto engine as default.
|
CURLE_SSL_PEER_CERTIFICATE
(int)
|
|
CURLE_SSL_PINNEDPUBKEYNOTMATCH
(int)
|
Failed to match the pinned key specified with
CURLOPT_PINNEDPUBLICKEY .
|
CURLE_TELNET_OPTION_SYNTAX
(int)
|
|
CURLE_TOO_MANY_REDIRECTS
(int)
|
Too many redirects. When following redirects, libcurl hit the maximum amount.
The limit can be set with CURLOPT_MAXREDIRS .
|
CURLE_UNKNOWN_TELNET_OPTION
(int)
|
|
CURLE_UNSUPPORTED_PROTOCOL
(int)
|
The URL passed to libcurl used a protocol that libcurl does not support.
The issue might be a compile-time option that was not used,
a misspelled protocol string or just a protocol libcurl has no code for.
|
CURLE_URL_MALFORMAT
(int)
|
The URL was not properly formatted.
|
CURLE_URL_MALFORMAT_USER
(int)
|
|
CURLE_WEIRD_SERVER_REPLY
(int)
|
The server sent data libcurl could not parse.
This error code was known as CURLE_FTP_WEIRD_SERVER_REPLY
before cURL 7.51.0.
Available as of PHP 7.3.0 and cURL 7.51.0
|
CURLE_WRITE_ERROR
(int)
|
An error occurred when writing received data to a local file,
or an error was returned to libcurl from a write callback.
|