跳转到主要内容

constants_curl_error

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 ENTITY 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.