Created
April 1, 2021 08:33
-
-
Save nhuhoai/b6eeb829c5687a62f7519e0fc6fa3250 to your computer and use it in GitHub Desktop.
cURL error number list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* CURL error number list | |
* | |
* Sources: | |
* - https://www.php.net/manual/fr/function.curl-errno.php | |
* - https://curl.se/libcurl/c/libcurl-errors.html | |
* - https://timi.eu/docs/anatella/5_1_8_1_list-of-curl-error-co.html | |
* | |
* PHP Version 5.x, 7.x and 8.x | |
* | |
* @category Utils | |
* @package PhpConstants | |
* @author Nhu-Hoai Robert Vo <[email protected]> | |
* @copyright 2021 Nhu-Hoai Robert Vo | |
* @license https://opensource.org/licenses/mit-license.php MIT License | |
* @version GIT: 1.0.0 | |
* @link https://gist.github.com/nhuhoai | |
*/ | |
namespace NhuVo\PhpConstants; // Remove it or edit the namespace for your project | |
define( | |
"CURL_ERRNO_LIST", | |
[ | |
0 => ["code" => "OK", "description" => "All fine. Proceed as usual."], | |
1 => ["code" => "UNSUPPORTED_PROTOCOL", "description" => "The URL you passed to libcurl used a protocol that this “curl.exe” does not support. it can be a misspelled protocol string or just a protocol that curl has no code for."], | |
2 => ["code" => "FAILED_INIT", "description" => "Very early initialization code failed. This is likely to be an internal error or problem, or a resource problem where something fundamental couldn't get done at init time."], | |
3 => ["code" => "URL_MALFORMAT", "description" => "The URL was not properly formatted."], | |
4 => ["code" => "NOT_BUILT_IN", "description" => "A requested feature, protocol or option was not found built-in in this curl.exe. This means that a feature or option was not enabled or explicitly disabled when curl.exe was built and in order to get it to function you have to get a download another “curl.exe” executable."], | |
5 => ["code" => "COULDNT_RESOLVE_PROXY", "description" => "Couldn't resolve proxy. The given proxy host could not be resolved."], | |
6 => ["code" => "COULDNT_RESOLVE_HOST", "description" => "Couldn't resolve host. The given remote host was not resolved."], | |
7 => ["code" => "COULDNT_CONNECT", "description" => "Failed to connect() to host or proxy."], | |
8 => ["code" => "FTP_WEIRD_SERVER_REPLY", "description" => "The server sent data libcurl couldn't parse. This error code is used for more than just FTP and is aliased as CURLE_WEIRD_SERVER_REPLY since 7.51.0."], | |
9 => ["code" => "REMOTE_ACCESS_DENIED", "description" => "We were denied access to the resource given in the URL. For FTP, this occurs while trying to change to the remote directory."], | |
10 => ["code" => "FTP_ACCEPT_FAILED", "description" => "While waiting for the server to connect back when an active FTP session is used, an error code was sent over the control connection or similar."], | |
11 => ["code" => "FTP_WEIRD_PASS_REPLY", "description" => "After having sent the FTP password to the server, libcurl expects a proper reply. This error code indicates that an unexpected code was returned."], | |
12 => ["code" => "FTP_ACCEPT_TIMEOUT", "description" => "During an active FTP session while waiting for the server to connect, the CURLOPT_ACCEPTTIMEOUT_MS (or the internal default) timeout expired."], | |
13 => ["code" => "FTP_WEIRD_PASV_REPLY", "description" => "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."], | |
14 => ["code" => "FTP_WEIRD_227_FORMAT", "description" => "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."], | |
15 => ["code" => "FTP_CANT_GET_HOST", "description" => "An internal failure to lookup the host used for the new connection."], | |
16 => ["code" => "HTTP2", "description" => "A problem was detected in the HTTP2 framing layer. This is somewhat generic and can be one out of several problems, see the error buffer for details."], | |
17 => ["code" => "FTP_COULDNT_SET_TYPE", "description" => "Received an error when trying to set the transfer mode to binary or ASCII."], | |
18 => ["code" => "PARTIAL_FILE", "description" => "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 doesn't match the previously given size."], | |
19 => ["code" => "FTP_COULDNT_RETR_FILE", "description" => "This was either a weird reply to a 'RETR' command or a zero byte transfer complete."], | |
21 => ["code" => "QUOTE_ERROR", "description" => "When sending custom \"QUOTE\" commands to the remote server, one of the commands returned an error code that was 400 or higher (for FTP) or otherwise indicated unsuccessful completion of the command."], | |
22 => ["code" => "HTTP_RETURNED_ERROR", "description" => "This is returned if CURLOPT_FAILONERROR is set TRUE and the HTTP server returns an error code that is >= 400."], | |
23 => ["code" => "WRITE_ERROR", "description" => "An error occurred when writing received data to a local file, or an error was returned to libcurl from a write callback."], | |
25 => ["code" => "UPLOAD_FAILED", "description" => "Failed starting the upload. For FTP, the server typically denied the STOR command. The error buffer usually contains the server's explanation for this."], | |
26 => ["code" => "READ_ERROR", "description" => "There was a problem reading a local file or an error returned by the read callback."], | |
27 => ["code" => "OUT_OF_MEMORY", "description" => "A memory allocation request failed. This is serious badness and things are severely screwed up if this ever occurs."], | |
28 => ["code" => "OPERATION_TIMEDOUT", "description" => "Operation timeout. The specified time-out period was reached according to the conditions."], | |
30 => ["code" => "FTP_PORT_FAILED", "description" => "The FTP PORT command returned error. This mostly happens when you haven't specified a good enough address for libcurl to use. See CURLOPT_FTPPORT."], | |
31 => ["code" => "FTP_COULDNT_USE_REST", "description" => "The FTP REST command returned error. This should never happen if the server is sane."], | |
33 => ["code" => "RANGE_ERROR", "description" => "The server does not support or accept range requests."], | |
34 => ["code" => "HTTP_POST_ERROR", "description" => "This is an odd error that mainly occurs due to internal confusion."], | |
35 => ["code" => "SSL_CONNECT_ERROR", "description" => "A problem occurred somewhere in the SSL/TLS handshake. You really want the error buffer and read the message there as it pinpoints the problem slightly more. Could be certificates (file formats, paths, permissions), passwords, and others."], | |
36 => ["code" => "BAD_DOWNLOAD_RESUME", "description" => "The download could not be resumed because the specified offset was out of the file boundary."], | |
37 => ["code" => "FILE_COULDNT_READ_FILE", "description" => "A file given with FILE:// couldn't be opened. Most likely because the file path doesn't identify an existing file. Did you check file permissions?"], | |
38 => ["code" => "LDAP_CANNOT_BIND", "description" => "LDAP cannot bind. LDAP bind operation failed."], | |
39 => ["code" => "LDAP_SEARCH_FAILED", "description" => "LDAP search failed."], | |
41 => ["code" => "FUNCTION_NOT_FOUND", "description" => "Function not found. A required zlib function was not found."], | |
42 => ["code" => "ABORTED_BY_CALLBACK", "description" => "Aborted by callback. A callback returned \"abort\" to libcurl."], | |
43 => ["code" => "BAD_FUNCTION_ARGUMENT", "description" => "Internal error. A function was called with a bad parameter."], | |
45 => ["code" => "INTERFACE_FAILED", "description" => "Interface error. A specified outgoing interface could not be used. Set which interface to use for outgoing connections' source IP address with CURLOPT_INTERFACE."], | |
47 => ["code" => "TOO_MANY_REDIRECTS", "description" => "Too many redirects. When following redirects, libcurl hit the maximum amount. Set your limit with CURLOPT_MAXREDIRS."], | |
48 => ["code" => "UNKNOWN_OPTION", "description" => "An option passed to libcurl is not recognized/known. Refer to the appropriate documentation. This is most likely a problem in the program that uses libcurl. The error buffer might contain more specific information about which exact option it concerns."], | |
49 => ["code" => "TELNET_OPTION_SYNTAX", "description" => "A telnet option string was Illegally formatted."], | |
51 => ["code" => "PEER_FAILED_VERIFICATION", "description" => "The remote server's SSL certificate or SSH md5 fingerprint was deemed not OK."], | |
52 => ["code" => "GOT_NOTHING", "description" => "Nothing was returned from the server, and under the circumstances, getting nothing is considered an error."], | |
53 => ["code" => "SSL_ENGINE_NOTFOUND", "description" => "The specified crypto engine wasn't found."], | |
54 => ["code" => "SSL_ENGINE_SETFAILED", "description" => "Failed setting the selected SSL crypto engine as default!"], | |
55 => ["code" => "SEND_ERROR", "description" => "Failed sending network data."], | |
56 => ["code" => "RECV_ERROR", "description" => "Failure with receiving network data."], | |
58 => ["code" => "SSL_CERTPROBLEM", "description" => "problem with the local client certificate."], | |
59 => ["code" => "SSL_CIPHER", "description" => "Couldn't use specified cipher."], | |
60 => ["code" => "SSL_CACERT", "description" => "Peer certificate cannot be authenticated with known CA certificates."], | |
61 => ["code" => "BAD_CONTENT_ENCODING", "description" => "Unrecognized transfer encoding."], | |
62 => ["code" => "LDAP_INVALID_URL", "description" => "Invalid LDAP URL."], | |
63 => ["code" => "FILESIZE_EXCEEDED", "description" => "Maximum file size exceeded."], | |
64 => ["code" => "USE_SSL_FAILED", "description" => "Requested FTP SSL level failed."], | |
65 => ["code" => "SEND_FAIL_REWIND", "description" => "When doing a send operation curl had to rewind the data to retransmit, but the rewinding operation failed."], | |
66 => ["code" => "SSL_ENGINE_INITFAILED", "description" => "Initiating the SSL Engine failed."], | |
67 => ["code" => "LOGIN_DENIED", "description" => "The remote server denied curl to login (Added in 7.13.1)"], | |
68 => ["code" => "TFTP_NOTFOUND", "description" => "File not found on TFTP server."], | |
69 => ["code" => "TFTP_PERM", "description" => "Permission problem on TFTP server."], | |
70 => ["code" => "REMOTE_DISK_FULL", "description" => "Out of disk space on the server."], | |
71 => ["code" => "TFTP_ILLEGAL", "description" => "Illegal TFTP operation."], | |
72 => ["code" => "TFTP_UNKNOWNID", "description" => "Unknown TFTP transfer ID."], | |
73 => ["code" => "REMOTE_FILE_EXISTS", "description" => "File already exists and will not be overwritten."], | |
74 => ["code" => "TFTP_NOSUCHUSER", "description" => "This error should never be returned by a properly functioning TFTP server."], | |
75 => ["code" => "CONV_FAILED", "description" => "Character conversion failed."], | |
76 => ["code" => "CONV_REQD", "description" => "Caller must register conversion callbacks."], | |
77 => ["code" => "SSL_CACERT_BADFILE", "description" => "Problem with reading the SSL CA cert (path? access rights?)"], | |
78 => ["code" => "REMOTE_FILE_NOT_FOUND", "description" => "The resource referenced in the URL does not exist."], | |
79 => ["code" => "SSH", "description" => "An unspecified error occurred during the SSH session."], | |
80 => ["code" => "SSL_SHUTDOWN_FAILED", "description" => "Failed to shut down the SSL connection."], | |
81 => ["code" => "AGAIN", "description" => "Socket is not ready for send/recv wait till it's ready and try again. This return code is only returned from curl_easy_recv and curl_easy_send (Added in 7.18.2)"], | |
82 => ["code" => "SSL_CRL_BADFILE", "description" => "Failed to load CRL file (Added in 7.19.0)"], | |
83 => ["code" => "SSL_ISSUER_ERROR", "description" => "Issuer check failed (Added in 7.19.0)"], | |
84 => ["code" => "FTP_PRET_FAILED", "description" => "The FTP server does not understand the PRET command at all or does not support the given argument. Be careful when using CURLOPT_CUSTOMREQUEST, a custom LIST command will be sent with PRET CMD before PASV as well. (Added in 7.20.0)"], | |
85 => ["code" => "RTSP_CSEQ_ERROR", "description" => "Mismatch of RTSP CSeq numbers."], | |
86 => ["code" => "RTSP_SESSION_ERROR", "description" => "Mismatch of RTSP Session Identifiers."], | |
87 => ["code" => "FTP_BAD_FILE_LIST", "description" => "Unable to parse FTP file list (during FTP wildcard downloading)."], | |
88 => ["code" => "CHUNK_FAILED", "description" => "Chunk callback reported error."], | |
89 => ["code" => "NO_CONNECTION_AVAILABLE", "description" => "(For internal use only, will never be returned by libcurl) No connection available, the session will be queued. (added in 7.30.0)"], | |
90 => ["code" => "SSL_PINNEDPUBKEYNOTMATCH", "description" => "Failed to match the pinned key specified with CURLOPT_PINNEDPUBLICKEY."], | |
91 => ["code" => "SSL_INVALIDCERTSTATUS", "description" => "Status returned failure when asked with CURLOPT_SSL_VERIFYSTATUS."], | |
92 => ["code" => "HTTP2_STREAM", "description" => "Stream error in the HTTP/2 framing layer."] | |
] | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment