curl_strerror
Function • Params and return types changed in PHP 8.0
Return string describing the given error code.
curl_strerror
Function synopsis
curl_strerror(int $error_code): ?string
Parameters
$error_code
Typeint
One of the cURL error codes constants.
$error_code
accepts one of the following constant values:
CURLE_OK
CURLE_UNSUPPORTED_PROTOCOL
CURLE_FAILED_INIT
CURLE_URL_MALFORMAT
CURLE_URL_MALFORMAT_USER
CURLE_COULDNT_RESOLVE_PROXY
CURLE_COULDNT_RESOLVE_HOST
CURLE_COULDNT_CONNECT
CURLE_FTP_WEIRD_SERVER_REPLY
CURLE_FTP_ACCESS_DENIED
CURLE_FTP_USER_PASSWORD_INCORRECT
CURLE_FTP_WEIRD_PASS_REPLY
CURLE_FTP_WEIRD_USER_REPLY
CURLE_FTP_WEIRD_PASV_REPLY
CURLE_FTP_WEIRD_227_FORMAT
CURLE_FTP_CANT_GET_HOST
CURLE_FTP_CANT_RECONNECT
CURLE_FTP_COULDNT_SET_BINARY
CURLE_PARTIAL_FILE
CURLE_FTP_COULDNT_RETR_FILE
CURLE_FTP_WRITE_ERROR
CURLE_FTP_QUOTE_ERROR
CURLE_HTTP_NOT_FOUND
CURLE_WRITE_ERROR
CURLE_MALFORMAT_USER
CURLE_FTP_COULDNT_STOR_FILE
CURLE_READ_ERROR
CURLE_OUT_OF_MEMORY
CURLE_OPERATION_TIMEOUTED
CURLE_FTP_COULDNT_SET_ASCII
CURLE_FTP_PORT_FAILED
CURLE_FTP_COULDNT_USE_REST
CURLE_FTP_COULDNT_GET_SIZE
CURLE_HTTP_RANGE_ERROR
CURLE_HTTP_POST_ERROR
CURLE_SSL_CONNECT_ERROR
CURLE_FTP_BAD_DOWNLOAD_RESUME
CURLE_FILE_COULDNT_READ_FILE
CURLE_LDAP_CANNOT_BIND
CURLE_LDAP_SEARCH_FAILED
CURLE_LIBRARY_NOT_FOUND
CURLE_FUNCTION_NOT_FOUND
CURLE_ABORTED_BY_CALLBACK
CURLE_BAD_FUNCTION_ARGUMENT
CURLE_BAD_CALLING_ORDER
CURLE_HTTP_PORT_FAILED
CURLE_BAD_PASSWORD_ENTERED
CURLE_TOO_MANY_REDIRECTS
CURLE_UNKNOWN_TELNET_OPTION
CURLE_TELNET_OPTION_SYNTAX
CURLE_OBSOLETE
CURLE_SSL_PEER_CERTIFICATE
CURLE_GOT_NOTHING
CURLE_SSL_ENGINE_NOTFOUND
CURLE_SSL_ENGINE_SETFAILED
CURLE_SEND_ERROR
CURLE_RECV_ERROR
CURLE_SHARE_IN_USE
CURLE_SSL_CERTPROBLEM
CURLE_SSL_CIPHER
CURLE_SSL_CACERT
CURLE_BAD_CONTENT_ENCODING
CURLE_LDAP_INVALID_URL
CURLE_FILESIZE_EXCEEDED
CURLE_FTP_SSL_FAILED
CURLE_BAD_DOWNLOAD_RESUME
CURLE_FTP_PARTIAL_FILE
CURLE_HTTP_RETURNED_ERROR
CURLE_OPERATION_TIMEDOUT
CURLE_SSL_PINNEDPUBKEYNOTMATCH
CURLE_SSL_CACERT_BADFILE
CURLE_SSH
CURLE_WEIRD_SERVER_REPLY
Return value
Type?string
Returns error description or null
for invalid error code.
Changes to the curl_strerror
Function
PHP 8.0
- Return type added:
?string
- Parameter name of parameter #1 changed:
$errornum
to$error_code
- Parameter type added for parameter #1 (
$error_code
):int
- curl_strerror($errornum)
+ curl_strerror(int $error_code): ?string
PHP 5.5
- Function added
curl_strerror
Function Availability
curl_strerror
Function AvailabilityPHP Version | Availability |
---|---|
PHP 8.5Future Release | Yes |
PHP 8.4Upcoming Release | Yes |
PHP 8.3Supported (Latest) | Yes |
PHP 8.2Supported | Yes |
PHP 8.1Security-Fixes Only | Yes |
PHP 8.0Unsupported | Yes |
PHP 7.4Unsupported | Yes |
PHP 7.3Unsupported | Yes |
PHP 7.2Unsupported | Yes |
PHP 7.1Unsupported | Yes |
PHP 7.0Unsupported | Yes |
PHP 5.6Unsupported | Yes |
PHP 5.5Unsupported | Yes |
PHP 5.4Unsupported | No |
PHP 5.3Unsupported | No |