search
HomeBackend DevelopmentPHP ProblemWhat are the php curl error codes?

What are the php curl error codes?

Oct 21, 2022 am 10:05 AM
phpcurl function

php curl error codes are: 1. "CURLE_UNSUPPORTED_PROTOCOL (1)", which means the protocol string is spelled incorrectly, or the protocol is not specified; 2. "CURLE_FAILED_INIT (2)", which means the initialization code failed; 3. "CURLE_URL_MALFORMAT (3)" means that the URL format is incorrect, etc.

What are the php curl error codes?

The operating environment of this tutorial: Windows 7 system, PHP version 8.1, Dell G3 computer.

PHP CURL error code description

curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));//Generally do not add

<?php
return [
&#39;1&#39;=>&#39;CURLE_UNSUPPORTED_PROTOCOL (1) – 您传送给 libcurl 的网址使用了此 libcurl 不支持的协议。 可能是您没有使用的编译时选项造成了这种情况(可能是协议字符串拼写有误,或没有指定协议 libcurl 代码)。&#39;,
&#39;2&#39;=>&#39;CURLE_FAILED_INIT (2) – 非常早期的初始化代码失败。 可能是内部错误或问题。&#39;,
&#39;3&#39;=>&#39;CURLE_URL_MALFORMAT (3) – 网址格式不正确。&#39;,
&#39;5&#39;=>&#39;CURLE_COULDNT_RESOLVE_PROXY (5) – 无法解析代理服务器。 指定的代理服务器主机无法解析。&#39;,
&#39;6&#39;=>&#39;CURLE_COULDNT_RESOLVE_HOST (6) – 无法解析主机。 指定的远程主机无法解析。&#39;,
&#39;7&#39;=>&#39;CURLE_COULDNT_CONNECT (7) – 无法通过 connect() 连接至主机或代理服务器。&#39;,
&#39;8&#39;=>&#39;CURLE_FTP_WEIRD_SERVER_REPLY (8) – 在连接到 FTP 服务器后,libcurl 需要收到特定的回复。 此错误代码表示收到了不正常或不正确的回复。 指定的远程服务器可能不是正确的 FTP 服务器。&#39;,
&#39;9&#39;=>&#39;CURLE_REMOTE_ACCESS_DENIED (9) – 我们无法访问网址中指定的资源。 对于 FTP,如果尝试更改为远程目录,就会发生这种情况。&#39;,
&#39;11&#39;=>&#39;CURLE_FTP_WEIRD_PASS_REPLY (11) – 在将 FTP 密码发送到服务器后,libcurl 需要收到正确的回复。 此错误代码表示返回的是意外的代码。&#39;,
&#39;13&#39;=>&#39;CURLE_FTP_WEIRD_PASV_REPLY (13) – libcurl 无法从服务器端收到有用的结果,作为对 PASV 或 EPSV 命令的响应。 服务器有问题。&#39;,
&#39;14&#39;=>&#39;CURLE_FTP_WEIRD_227_FORMAT (14) – FTP 服务器返回 227 行作为对 PASV 命令的响应。如果 libcurl 无法解析此行,就会返回此代码。&#39;,
&#39;15&#39;=>&#39;CURLE_FTP_CANT_GET_HOST (15) – 在查找用于新连接的主机时出现内部错误。&#39;,
&#39;17&#39;=>&#39;CURLE_FTP_COULDNT_SET_TYPE (17) – 在尝试将传输模式设置为二进制或 ascii 时发生错误。&#39;,
&#39;18&#39;=>&#39;CURLE_PARTIAL_FILE (18) – 文件传输尺寸小于或大于预期。当服务器先报告了一个预期的传输尺寸,然后所传送的数据与先前指定尺寸不相符时,就会发生此错误。&#39;,
&#39;19&#39;=>&#39;CURLE_FTP_COULDNT_RETR_FILE (19) – ‘RETR’ 命令收到了不正常的回复,或完成的传输尺寸为零字节。&#39;,
&#39;21&#39;=>&#39;CURLE_QUOTE_ERROR (21) – 在向远程服务器发送自定义 “QUOTE” 命令时,其中一个命令返回的错误代码为 400 或更大的数字(对于 FTP),或以其他方式表明命令无法成功完成。&#39;,
&#39;22&#39;=>&#39;CURLE_HTTP_RETURNED_ERROR (22) – 如果 CURLOPT_FAILONERROR 设置为 TRUE,且 HTTP 服务器返回 >= 400 的错误代码,就会返回此代码。 (此错误代码以前又称为 CURLE_HTTP_NOT_FOUND。)&#39;,
&#39;23&#39;=>&#39;CURLE_WRITE_ERROR (23) – 在向本地文件写入所收到的数据时发生错误,或由写入回调 (write callback) 向 libcurl 返回了一个错误。&#39;,
&#39;25&#39;=>&#39;CURLE_UPLOAD_FAILED (25) – 无法开始上传。 对于 FTP,服务器通常会拒绝执行 STOR 命令。错误缓冲区通常会提供服务器对此问题的说明。 (此错误代码以前又称为 CURLE_FTP_COULDNT_STOR_FILE。)&#39;,
&#39;26&#39;=>&#39;CURLE_READ_ERROR (26) – 读取本地文件时遇到问题,或由读取回调 (read callback) 返回了一个错误。&#39;,
&#39;27&#39;=>&#39;CURLE_OUT_OF_MEMORY (27) – 内存分配请求失败。此错误比较严重,若发生此错误,则表明出现了非常严重的问题。&#39;,
&#39;28&#39;=>&#39;CURLE_OPERATION_TIMEDOUT (28) – 操作超时。 已达到根据相应情况指定的超时时间。&#39;,
&#39;30&#39;=>&#39;CURLE_FTP_PORT_FAILED (30) – FTP PORT 命令返回错误。 在没有为 libcurl 指定适当的地址使用时,最有可能发生此问题。 请参阅 CURLOPT_FTPPORT。&#39;,
&#39;31&#39;=>&#39;CURLE_FTP_COULDNT_USE_REST (31) – FTP REST 命令返回错误。如果服务器正常,则应当不会发生这种情况。&#39;,
&#39;33&#39;=>&#39;CURLE_RANGE_ERROR (33) – 服务器不支持或不接受范围请求。&#39;,
&#39;34&#39;=>&#39;CURLE_HTTP_POST_ERROR (34) – 此问题比较少见,主要由内部混乱引发。&#39;,
&#39;35&#39;=>&#39;CURLE_SSL_CONNECT_ERROR (35) – 同时使用 SSL/TLS 时可能会发生此错误。您可以访问错误缓冲区查看相应信息,其中会对此问题进行更详细的介绍。可能是证书(文件格式、路径、许可)、密码及其他因素导致了此问题。&#39;,
&#39;36&#39;=>&#39;CURLE_FTP_BAD_DOWNLOAD_RESUME (36) – 尝试恢复超过文件大小限制的 FTP 连接。&#39;,
&#39;37&#39;=>&#39;CURLE_FILE_COULDNT_READ_FILE (37) – 无法打开 FILE:// 路径下的文件。原因很可能是文件路径无法识别现有文件。 建议您检查文件的访问权限。&#39;,
&#39;38&#39;=>&#39;CURLE_LDAP_CANNOT_BIND (38) – LDAP 无法绑定。LDAP 绑定操作失败。&#39;,
&#39;39&#39;=>&#39;CURLE_LDAP_SEARCH_FAILED (39) – LDAP 搜索无法进行。&#39;,
&#39;41&#39;=>&#39;CURLE_FUNCTION_NOT_FOUND (41) – 找不到函数。 找不到必要的 zlib 函数。&#39;,
&#39;42&#39;=>&#39;CURLE_ABORTED_BY_CALLBACK (42) – 由回调中止。 回调向 libcurl 返回了 “abort”。&#39;,
&#39;43&#39;=>&#39;CURLE_BAD_FUNCTION_ARGUMENT (43) – 内部错误。 使用了不正确的参数调用函数。&#39;,
&#39;45&#39;=>&#39;CURLE_INTERFACE_FAILED (45) – 界面错误。 指定的外部界面无法使用。 请通过 CURLOPT_INTERFACE 设置要使用哪个界面来处理外部连接的来源 IP 地址。 (此错误代码以前又称为 CURLE_HTTP_PORT_FAILED。)&#39;,
&#39;47&#39;=>&#39;CURLE_TOO_MANY_REDIRECTS (47) – 重定向过多。 进行重定向时,libcurl 达到了网页点击上限。请使用 CURLOPT_MAXREDIRS 设置上限。&#39;,
&#39;48&#39;=>&#39;CURLE_UNKNOWN_TELNET_OPTION (48) – 无法识别以 CURLOPT_TELNETOPTIONS 设置的选项。 请参阅相关文档。&#39;,
&#39;49&#39;=>&#39;CURLE_TELNET_OPTION_SYNTAX (49) – telnet 选项字符串的格式不正确。&#39;,
&#39;51&#39;=>&#39;CURLE_PEER_FAILED_VERIFICATION (51) – 远程服务器的 SSL 证书或 SSH md5 指纹不正确。&#39;,
&#39;52&#39;=>&#39;CURLE_GOT_NOTHING (52) – 服务器未返回任何数据,在相应情况下,未返回任何数据就属于出现错误。&#39;,
&#39;53&#39;=>&#39;CURLE_SSL_ENGINE_NOTFOUND (53) – 找不到指定的加密引擎。&#39;,
&#39;54&#39;=>&#39;CURLE_SSL_ENGINE_SETFAILED (54) – 无法将选定的 SSL 加密引擎设为默认选项。&#39;,
&#39;55&#39;=>&#39;CURLE_SEND_ERROR (55) – 无法发送网络数据。&#39;,
&#39;56&#39;=>&#39;CURLE_RECV_ERROR (56) – 接收网络数据失败。&#39;,
&#39;58&#39;=>&#39;CURLE_SSL_CERTPROBLEM (58) – 本地客户端证书有问题&#39;,
&#39;59&#39;=>&#39;CURLE_SSL_CIPHER (59) – 无法使用指定的密钥&#39;,
&#39;60&#39;=>&#39;CURLE_SSL_CACERT (60) – 无法使用已知的 CA 证书验证对等证书&#39;,
&#39;61&#39;=>&#39;CURLE_BAD_CONTENT_ENCODING (61) – 无法识别传输编码&#39;,
&#39;62&#39;=>&#39;CURLE_LDAP_INVALID_URL (62) – LDAP 网址无效&#39;,
&#39;63&#39;=>&#39;CURLE_FILESIZE_EXCEEDED (63) – 超过了文件大小上限&#39;,
&#39;64&#39;=>&#39;CURLE_USE_SSL_FAILED (64) – 请求的 FTP SSL 级别失败&#39;,
&#39;65&#39;=>&#39;CURLE_SEND_FAIL_REWIND (65) – 进行发送操作时,curl 必须回转数据以便重新传输,但回转操作未能成功&#39;,
&#39;66&#39;=>&#39;CURLE_SSL_ENGINE_INITFAILED (66) – SSL 引擎初始化失败&#39;,
&#39;67&#39;=>&#39;CURLE_LOGIN_DENIED (67) – 远程服务器拒绝 curl 登录(7.13.1 新增功能)&#39;,
&#39;68&#39;=>&#39;CURLE_TFTP_NOTFOUND (68) – 在 TFTP 服务器上找不到文件&#39;,
&#39;69&#39;=>&#39;CURLE_TFTP_PERM (69) – 在 TFTP 服务器上遇到权限问题&#39;,
&#39;70&#39;=>&#39;CURLE_REMOTE_DISK_FULL (70) – 服务器磁盘空间不足&#39;,
&#39;71&#39;=>&#39;CURLE_TFTP_ILLEGAL (71) – TFTP 操作非法&#39;,
&#39;72&#39;=>&#39;CURLE_TFTP_UNKNOWNID (72) – TFTP 传输 ID 未知&#39;,
&#39;73&#39;=>&#39;CURLE_REMOTE_FILE_EXISTS (73) – 文件已存在,无法覆盖&#39;,
&#39;74&#39;=>&#39;CURLE_TFTP_NOSUCHUSER (74) – 运行正常的 TFTP 服务器不会返回此错误&#39;,
&#39;75&#39;=>&#39;CURLE_CONV_FAILED (75) – 字符转换失败&#39;,
&#39;76&#39;=>&#39;CURLE_CONV_REQD (76) – 调用方必须注册转换回调&#39;,
&#39;77&#39;=>&#39;CURLE_SSL_CACERT_BADFILE (77) – 读取 SSL CA 证书时遇到问题(可能是路径错误或访问权限问题)&#39;,
&#39;78&#39;=>&#39;CURLE_REMOTE_FILE_NOT_FOUND (78) – 网址中引用的资源不存在&#39;,
&#39;79&#39;=>&#39;CURLE_SSH (79) – SSH 会话中发生无法识别的错误&#39;,
&#39;80&#39;=>&#39;CURLE_SSL_SHUTDOWN_FAILED (80) – 无法终止 SSL 连接&#39;
];

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of What are the php curl error codes?. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
ACID vs BASE Database: Differences and when to use each.ACID vs BASE Database: Differences and when to use each.Mar 26, 2025 pm 04:19 PM

The article compares ACID and BASE database models, detailing their characteristics and appropriate use cases. ACID prioritizes data integrity and consistency, suitable for financial and e-commerce applications, while BASE focuses on availability and

PHP Secure File Uploads: Preventing file-related vulnerabilities.PHP Secure File Uploads: Preventing file-related vulnerabilities.Mar 26, 2025 pm 04:18 PM

The article discusses securing PHP file uploads to prevent vulnerabilities like code injection. It focuses on file type validation, secure storage, and error handling to enhance application security.

PHP Input Validation: Best practices.PHP Input Validation: Best practices.Mar 26, 2025 pm 04:17 PM

Article discusses best practices for PHP input validation to enhance security, focusing on techniques like using built-in functions, whitelist approach, and server-side validation.

PHP API Rate Limiting: Implementation strategies.PHP API Rate Limiting: Implementation strategies.Mar 26, 2025 pm 04:16 PM

The article discusses strategies for implementing API rate limiting in PHP, including algorithms like Token Bucket and Leaky Bucket, and using libraries like symfony/rate-limiter. It also covers monitoring, dynamically adjusting rate limits, and hand

PHP Password Hashing: password_hash and password_verify.PHP Password Hashing: password_hash and password_verify.Mar 26, 2025 pm 04:15 PM

The article discusses the benefits of using password_hash and password_verify in PHP for securing passwords. The main argument is that these functions enhance password protection through automatic salt generation, strong hashing algorithms, and secur

OWASP Top 10 PHP: Describe and mitigate common vulnerabilities.OWASP Top 10 PHP: Describe and mitigate common vulnerabilities.Mar 26, 2025 pm 04:13 PM

The article discusses OWASP Top 10 vulnerabilities in PHP and mitigation strategies. Key issues include injection, broken authentication, and XSS, with recommended tools for monitoring and securing PHP applications.

PHP XSS Prevention: How to protect against XSS.PHP XSS Prevention: How to protect against XSS.Mar 26, 2025 pm 04:12 PM

The article discusses strategies to prevent XSS attacks in PHP, focusing on input sanitization, output encoding, and using security-enhancing libraries and frameworks.

PHP Interface vs Abstract Class: When to use each.PHP Interface vs Abstract Class: When to use each.Mar 26, 2025 pm 04:11 PM

The article discusses the use of interfaces and abstract classes in PHP, focusing on when to use each. Interfaces define a contract without implementation, suitable for unrelated classes and multiple inheritance. Abstract classes provide common funct

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.