预定义常量
下列常量由此扩展定义,且仅在此扩展编译入 PHP 或在运行时动态载入时可用。
curl_setopt()、curl_multi_setopt()、 curl_getinfo() 文档中常量的描述和使用。
常量 | 描述 |
---|---|
CURLALTSVC_H1
(int)
|
自 PHP 8.2.0 和 cURL 7.64.1 起可用。 |
CURLALTSVC_H2
(int)
|
自 PHP 8.2.0 和 cURL 7.64.1 起可用。 |
CURLALTSVC_H3
(int)
|
自 PHP 8.2.0 和 cURL 7.64.1 起可用。 |
CURLALTSVC_READONLYFILE
(int)
|
自 PHP 8.2.0 和 cURL 7.64.1 起可用。 |
CURLAUTH_ANY
(int)
|
|
CURLAUTH_ANYSAFE
(int)
|
|
CURLAUTH_AWS_SIGV4
(int)
|
自 PHP 8.2.0 和 cURL 7.75.0 起可用。 |
CURLAUTH_BASIC
(int)
|
|
CURLAUTH_BEARER
(int)
|
自 PHP 7.3.0 和 cURL 7.61.0 起可用。 |
CURLAUTH_DIGEST
(int)
|
|
CURLAUTH_DIGEST_IE
(int)
|
使用带有 IE 风格的 HTTP 摘要认证。自 cURL 7.19.3 起可用。 |
CURLAUTH_GSSAPI
(int)
|
自 PHP 7.3.0 和 cURL 7.54.1 起可用 |
CURLAUTH_GSSNEGOTIATE
(int)
|
|
CURLAUTH_NEGOTIATE
(int)
|
自 PHP 7.0.7 和 cURL 7.38.0 起可用。 |
CURLAUTH_NONE
(int)
|
自 cURL 7.10.6 起可用。 |
CURLAUTH_NTLM
(int)
|
|
CURLAUTH_NTLM_WB
(int)
|
自 PHP 7.0.7 和 cURL 7.22.0 起可用 |
CURLAUTH_ONLY
(int)
|
这是元符号。将此值与单个特定认证值进行 OR 运算,以强制 libcurl 探测不受限制的认证方法;如果不可用,则仅接受该单个认证算法。自 cURL 7.21.3 起可用。 |
CURLFTPAUTH_DEFAULT
(int)
|
|
CURLFTPAUTH_SSL
(int)
|
|
CURLFTPAUTH_TLS
(int)
|
|
CURLFTPMETHOD_DEFAULT
(int)
|
自 PHP 8.2.0 和 cURL 7.15.3 起可用。 |
CURLFTPMETHOD_MULTICWD
(int)
|
对指定 URL 中的每个路径部分执行一次 CWD 操作。自 cURL 7.15.3 起可用。
|
CURLFTPMETHOD_NOCWD
(int)
|
libcurl 完全不执行 CWD 操作。libcurl
执行 SIZE 、RETR 、STOR 等命令,并为这些命令向服务器提供完整路径。自
cURL 7.15.3 起可用。
|
CURLFTPMETHOD_SINGLECWD
(int)
|
libcurl 使用完整的目标目录执行一次 CWD
操作,然后像在多次 CWD 情况下对文件进行操作。自 cURL 7.15.3 起可用。
|
CURLFTPSSL_ALL
(int)
|
|
CURLFTPSSL_CCC_ACTIVE
(int)
|
发起关闭操作并等待回复。自 cURL 7.16.2 起可用。 |
CURLFTPSSL_CCC_NONE
(int)
|
不要尝试使用 CCC(清除命令通道)。自 cURL 7.16.2 起可用。 |
CURLFTPSSL_CCC_PASSIVE
(int)
|
不要发起关闭操作,而是等待服务器进行关闭。不要发送回复。自 cURL 7.16.1 起可用。 |
CURLFTPSSL_CONTROL
(int)
|
|
CURLFTPSSL_NONE
(int)
|
|
CURLFTPSSL_TRY
(int)
|
|
CURLFTP_CREATE_DIR
(int)
|
自 PHP 7.0.7 和 cURL 7.19.3 起可用 |
CURLFTP_CREATE_DIR_NONE
(int)
|
自 PHP 7.0.7 和 cURL 7.19.3 起可用 |
CURLFTP_CREATE_DIR_RETRY
(int)
|
自 PHP 7.0.7 和 cURL 7.19.3 起可用 |
CURLGSSAPI_DELEGATION_FLAG
(int)
|
允许无条件的 GSSAPI 凭证委派。自 cURL 7.22.0 起可用。 |
CURLGSSAPI_DELEGATION_POLICY_FLAG
(int)
|
仅当服务票据(service ticket)中设置了 OK-AS-DELEGATE
flag 的情况下进行委托,前提是由 GSS-API 实现支持此功能,并且在编译时定义了 GSS_C_DELEG_POLICY_FLAG 时可用。自 cURL 7.22.0 起可用。
|
CURLHEADER_SEPARATE
(int)
|
自 PHP 7.0.7 和 cURL 7.37.0 起可用。 |
CURLHEADER_UNIFIED
(int)
|
自 PHP 7.0.7 和 cURL 7.37.0 起可用。 |
CURLHSTS_ENABLE
(int)
|
自 PHP 8.2.0 和 cURL 7.74.0 起可用 |
CURLHSTS_READONLYFILE
(int)
|
自 PHP 8.2.0 和 cURL 7.74.0 起可用 |
CURLKHMATCH_LAST
(int)
|
自 PHP 8.3.0 和 cURL 7.19.6 起可用 |
CURLKHMATCH_MISMATCH
(int)
|
自 PHP 8.3.0 和 cURL 7.19.6 起可用 |
CURLKHMATCH_MISSING
(int)
|
自 PHP 8.3.0 和 cURL 7.19.6 起可用 |
CURLKHMATCH_OK
(int)
|
自 PHP 8.3.0 和 cURL 7.19.6 起可用 |
CURLMIMEOPT_FORMESCAPE
(int)
|
自 PHP 8.3.0 和 cURL 7.81.0 起可用 |
CURLMSG_DONE
(int)
|
|
CURLPIPE_HTTP1
(int)
|
自 cURL 7.43.0 起可用。 |
CURLPIPE_MULTIPLEX
(int)
|
自 cURL 7.43.0 起可用。 |
CURLPIPE_NOTHING
(int)
|
自 cURL 7.43.0 起可用。 |
CURLPROXY_HTTP
(int)
|
自 cURL 7.10 起可用。 |
CURLPROXY_HTTPS
(int)
|
自 PHP 7.3.0 和 cURL 7.52.0 起可用 |
CURLPROXY_HTTP_1_0
(int)
|
自 PHP 7.0.7 和 cURL 7.19.3 起可用 |
CURLPROXY_SOCKS4
(int)
|
自 cURL 7.10 起可用。 |
CURLPROXY_SOCKS4A
(int)
|
自 cURL 7.18.0 起可用。 |
CURLPROXY_SOCKS5
(int)
|
自 cURL 7.10 起可用。 |
CURLPROXY_SOCKS5_HOSTNAME
(int)
|
自 cURL 7.18.0 起可用。 |
CURLPX_BAD_ADDRESS_TYPE
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_BAD_VERSION
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_CLOSED
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_GSSAPI
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_GSSAPI_PERMSG
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_GSSAPI_PROTECTION
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_IDENTD
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_IDENTD_DIFFER
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_LONG_HOSTNAME
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_LONG_PASSWD
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_LONG_USER
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_NO_AUTH
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_OK
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_RECV_ADDRESS
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_RECV_AUTH
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_RECV_CONNECT
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_RECV_REQACK
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_REPLY_ADDRESS_TYPE_NOT_SUPPORTED
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_REPLY_COMMAND_NOT_SUPPORTED
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_REPLY_CONNECTION_REFUSED
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_REPLY_GENERAL_SERVER_FAILURE
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_REPLY_HOST_UNREACHABLE
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_REPLY_NETWORK_UNREACHABLE
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_REPLY_NOT_ALLOWED
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_REPLY_TTL_EXPIRED
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_REPLY_UNASSIGNED
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_REQUEST_FAILED
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_RESOLVE_HOST
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_SEND_AUTH
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_SEND_CONNECT
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_SEND_REQUEST
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_UNKNOWN_FAIL
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_UNKNOWN_MODE
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLPX_USER_REJECTED
(int)
|
自 PHP 8.2.0 和 cURL 7.73.0 起可用 |
CURLSSH_AUTH_AGENT
(int)
|
自 PHP 7.0.7 和 cURL 7.28.0 起可用 |
CURLSSH_AUTH_ANY
(int)
|
|
CURLSSH_AUTH_DEFAULT
(int)
|
|
CURLSSH_AUTH_GSSAPI
(int)
|
自 PHP 7.3.0 和 cURL 7.58.0 起可用 |
CURLSSH_AUTH_HOST
(int)
|
|
CURLSSH_AUTH_KEYBOARD
(int)
|
|
CURLSSH_AUTH_NONE
(int)
|
|
CURLSSH_AUTH_PASSWORD
(int)
|
|
CURLSSH_AUTH_PUBLICKEY
(int)
|
|
CURLSSLOPT_ALLOW_BEAST
(int)
|
自 cURL 7.25.0 起可用 |
CURLSSLOPT_AUTO_CLIENT_CERT
(int)
|
自 PHP 8.2.0 和 cURL 7.77.0 起可用 |
CURLSSLOPT_NATIVE_CA
(int)
|
自 PHP 8.2.0 和 cURL 7.71.0 起可用 |
CURLSSLOPT_NO_PARTIALCHAIN
(int)
|
自 PHP 8.2.0 和 cURL 7.68.0 起可用 |
CURLSSLOPT_NO_REVOKE
(int)
|
自 PHP 7.0.7 和 cURL 7.44.0 起可用 |
CURLSSLOPT_REVOKE_BEST_EFFORT
(int)
|
自 PHP 8.2.0 和 cURL 7.70.0 起可用 |
CURLUSESSL_ALL
(int)
|
所有通信都需要 SSL,否则会失败并出现 CURLE_USE_SSL_FAILED 。自 cURL 7.17.0 起可用。
|
CURLUSESSL_CONTROL
(int)
|
控制连接需要 SSL,否则会失败并出现 CURLE_USE_SSL_FAILED 。自 cURL 7.17.0 起可用。
|
CURLUSESSL_NONE
(int)
|
不要尝试使用 SSL。自 cURL 7.17.0 起可用。 |
CURLUSESSL_TRY
(int)
|
尝试使用 SSL,如果失败则按正常方式继续。注意,如果协商不成功,服务器可能会关闭连接。自 cURL 7.17.0 起可用。 |
CURLVERSION_NOW
(int)
|
|
CURLWS_RAW_MODE
(int)
|
自 PHP 8.3.0 和 cURL 7.86.0 起可用 |
CURL_FNMATCHFUNC_FAIL
(int)
|
如果发生错误,则由通配符匹配回调函数返回。自 cURL 7.21.0 起可用。 |
CURL_FNMATCHFUNC_MATCH
(int)
|
如果模式与字符串匹配,则由通配符匹配回调函数返回。自 cURL 7.21.0 起可用。 |
CURL_FNMATCHFUNC_NOMATCH
(int)
|
如果模式与字符串不匹配,则由通配符匹配回调函数返回。自 cURL 7.21.0 起可用。 |
CURL_HTTP_VERSION_1_0
(int)
|
|
CURL_HTTP_VERSION_1_1
(int)
|
|
CURL_HTTP_VERSION_2
(int)
|
自 PHP 7.0.7 和 cURL 7.43.0 起可用 |
CURL_HTTP_VERSION_2TLS
(int)
|
自 PHP 7.0.7 和 cURL 7.47.0 起可用 |
CURL_HTTP_VERSION_2_0
(int)
|
自 cURL 7.33.0 起可用 |
CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE
(int)
|
自 PHP 7.0.7 和 cURL 7.49.0 起可用 |
CURL_HTTP_VERSION_3
(int)
|
自 PHP 8.4.0 和 cURL 7.66.0 起可用。 |
CURL_HTTP_VERSION_3ONLY
(int)
|
自 PHP 8.4.0 和 cURL 7.88.0 起可用。 |
CURL_HTTP_VERSION_NONE
(int)
|
|
CURL_IPRESOLVE_V4
(int)
|
建立连接或从连接池中选一个时仅使用 IPv4 地址。自 cURL 7.10.8 起可用。 |
CURL_IPRESOLVE_V6
(int)
|
建立连接或从连接池中选一个时仅使用 IPv6 地址。自 cURL 7.10.8 起可用。 |
CURL_IPRESOLVE_WHATEVER
(int)
|
使用系统允许的所有 IP 版本的地址。自 cURL 7.10.8 起可用。 |
CURL_MAX_READ_SIZE
(int)
|
自 PHP 7.3.0 和 cURL 7.53.0 起可用 |
CURL_NETRC_IGNORED
(int)
|
|
CURL_NETRC_OPTIONAL
(int)
|
|
CURL_NETRC_REQUIRED
(int)
|
|
CURL_PUSH_DENY
(int)
|
自 PHP 7.1.0 和 cURL 7.44.0 起可用 |
CURL_PUSH_OK
(int)
|
自 PHP 7.1.0 和 cURL 7.44.0 起可用 |
CURL_READFUNC_PAUSE
(int)
|
自 cURL 7.18.0 起可用。 |
CURL_REDIR_POST_301
(int)
|
自 PHP 7.0.7 和 cURL 7.18.2 起可用 |
CURL_REDIR_POST_302
(int)
|
自 PHP 7.0.7 和 cURL 7.18.2 起可用 |
CURL_REDIR_POST_303
(int)
|
自 PHP 7.0.7 和 cURL 7.25.1 起可用 |
CURL_REDIR_POST_ALL
(int)
|
自 PHP 7.0.7 和 cURL 7.18.2 起可用 |
CURL_RTSPREQ_ANNOUNCE
(int)
|
当客户端发送时,该方法会更改会话的描述。ANNOUNCE
的作用类似于 HTTP PUT 或 POST,就像 CURL_RTSPREQ_SET_PARAMETER
一样。自 cURL 7.20.0 起可用。
|
CURL_RTSPREQ_DESCRIBE
(int)
|
用于获取流的低级描述。应用程序应在 Accept:
header 中注明其支持的格式。除非手动设置,否则 libcurl 会自动添加 Accept:
application/sdp 。如果使用了 CURLOPT_TIMECONDITION
选项,时间条件(Time-condition)header 将添加到 DESCRIBE 请求中。自 cURL 7.20.0 起可用。
|
CURL_RTSPREQ_GET_PARAMETER
(int)
|
从服务器检索参数。默认情况下,libcurl 会在所有非空请求中添加 Content-Type:
text/parameters header,除非设置了自定义标头。GET_PARAMETER
的作用与 HTTP 的 PUT 或 POST 相同。希望发送心跳消息的应用程序应使用空的
GET_PARAMETER 请求。自 cURL 7.20.0 起可用。
|
CURL_RTSPREQ_OPTIONS
(int)
|
用于检索服务器的可用方法。自 cURL 7.20.0 起可用。 |
CURL_RTSPREQ_PAUSE
(int)
|
向服务器发送 PAUSE 命令。使用 CURLOPT_RANGE 选项以及单个值来指示何时应停止流(例如
npt=25)。自 cURL 7.20.0 起可用。
|
CURL_RTSPREQ_PLAY
(int)
|
向服务器发送 PLAY 命令。使用
CURLOPT_RANGE 选项来修改播放时间(例如
npt=10-15)。自 cURL 7.20.0 起可用。
|
CURL_RTSPREQ_RECEIVE
(int)
|
将 RTSP 请求类型设置为此值以接收交替 RTP 数据。自 cURL 7.20.0 起可用。 |
CURL_RTSPREQ_RECORD
(int)
|
用于告诉服务器记录会话。使用 CURLOPT_RANGE 选项修改记录时间。自 cURL 7.20.0 起可用。
|
CURL_RTSPREQ_SETUP
(int)
|
用于初始化会话的传输层。自 cURL 7.20.0 起可用。 |
CURL_RTSPREQ_SET_PARAMETER
(int)
|
在服务器上设置参数。自 cURL 7.20.0 起可用。 |
CURL_RTSPREQ_TEARDOWN
(int)
|
终止 RTSP 会话。简单地关闭连接不会终止 RTSP 会话,因为通过不同的连接控制 RTSP 会话是有效的。自 cURL 7.20.0 起可用。 |
CURL_SSLVERSION_DEFAULT
(int)
|
|
CURL_SSLVERSION_MAX_DEFAULT
(int)
|
自 PHP 7.3.0 和 cURL 7.54.0 起可用 |
CURL_SSLVERSION_MAX_NONE
(int)
|
自 PHP 7.3.0 和 cURL 7.54.0 起可用 |
CURL_SSLVERSION_MAX_TLSv1_0
(int)
|
自 PHP 7.3.0 和 cURL 7.54.0 起可用 |
CURL_SSLVERSION_MAX_TLSv1_1
(int)
|
自 PHP 7.3.0 和 cURL 7.54.0 起可用 |
CURL_SSLVERSION_MAX_TLSv1_2
(int)
|
自 PHP 7.3.0 和 cURL 7.54.0 起可用 |
CURL_SSLVERSION_MAX_TLSv1_3
(int)
|
自 PHP 7.3.0 和 cURL 7.54.0 起可用 |
CURL_SSLVERSION_SSLv2
(int)
|
|
CURL_SSLVERSION_SSLv3
(int)
|
|
CURL_SSLVERSION_TLSv1
(int)
|
|
CURL_SSLVERSION_TLSv1_0
(int)
|
|
CURL_SSLVERSION_TLSv1_1
(int)
|
|
CURL_SSLVERSION_TLSv1_2
(int)
|
|
CURL_SSLVERSION_TLSv1_3
(int)
|
自 PHP 7.3.0 和 cURL 7.52.0 起可用 |
CURL_TIMECOND_IFMODSINCE
(int)
|
|
CURL_TIMECOND_IFUNMODSINCE
(int)
|
|
CURL_TIMECOND_LASTMOD
(int)
|
|
CURL_TIMECOND_NONE
(int)
|
|
CURL_TLSAUTH_SRP
(int)
|
自 cURL 7.21.4 起可用。 |
CURL_VERSION_ALTSVC
(int)
|
自 PHP 7.3.6 和 cURL 7.64.1 起可用 |
CURL_VERSION_ASYNCHDNS
(int)
|
异步 DNS 解析。自 PHP 7.3.0 和 cURL 7.10.7 起可用 |
CURL_VERSION_BROTLI
(int)
|
自 PHP 7.3.0 和 cURL 7.57.0 起可用 |
CURL_VERSION_CONV
(int)
|
字符转换支持。自 PHP 7.3.0 和 cURL 7.15.4 起可用 |
CURL_VERSION_CURLDEBUG
(int)
|
调试内存跟踪支持。自 PHP 7.3.6 和 cURL 7.19.6 起可用 |
CURL_VERSION_DEBUG
(int)
|
内置调试功能。自 PHP 7.3.0 和 cURL 7.10.6 起可用 |
CURL_VERSION_GSASL
(int)
|
自 PHP 8.2.0 和 cURL 7.76.0 起可用 |
CURL_VERSION_GSSAPI
(int)
|
基于 GSS-API 库编译。自 PHP 7.3.0 和 cURL 7.38.0 起可用 |
CURL_VERSION_GSSNEGOTIATE
(int)
|
支持协商(Negotiate)身份验证。自 PHP 7.3.0 和 cURL 7.10.6 起可用(自 cURL 7.38.0 起弃用) |
CURL_VERSION_HSTS
(int)
|
自 PHP 8.2.0 和 cURL 7.74.0 起可用 |
CURL_VERSION_HTTP2
(int)
|
内置 HTTP2 支持。自 cURL 7.33.0 起可用 |
CURL_VERSION_HTTP3
(int)
|
自 PHP 8.2.0 和 cURL 7.66.0 起可用 |
CURL_VERSION_HTTPS_PROXY
(int)
|
自 PHP 7.3.0 和 cURL 7.52.0 起可用 |
CURL_VERSION_IDN
(int)
|
国际化域名支持。自 PHP 7.3.0 和 cURL 7.12.0 起可用 |
CURL_VERSION_IPV6
(int)
|
启用 IPv6。 |
CURL_VERSION_KERBEROS4
(int)
|
Kerberos V4 身份验证支持。 |
CURL_VERSION_KERBEROS5
(int)
|
Kerberos V5 身份验证支持。自 PHP 7.0.7 和 cURL 7.40.0 起可用 |
CURL_VERSION_LARGEFILE
(int)
|
支持大于 2GB 的文件。自 cURL 7.33.0 起可用 |
CURL_VERSION_LIBZ
(int)
|
存在 libz 功能。 |
CURL_VERSION_MULTI_SSL
(int)
|
自 PHP 7.3.0 和 cURL 7.56.0 起可用 |
CURL_VERSION_NTLM
(int)
|
NTLM 身份验证支持。自 PHP 7.3.0 和 cURL 7.10.6 起可用 |
CURL_VERSION_NTLM_WB
(int)
|
支持 NTLM 委派给 winbind 助手。自 PHP 7.3.0 和 cURL 7.22.0 起可用 |
CURL_VERSION_PSL
(int)
|
Mozilla 的公共后缀列表,用于 cookie 域验证。自 PHP 7.3.6 和 cURL 7.47.0 起可用 |
CURL_VERSION_SPNEGO
(int)
|
SPNEGO 身份验证支持。自 PHP 7.3.0 和 cURL 7.10.8 起可用 |
CURL_VERSION_SSL
(int)
|
存在 SSL 选项。 |
CURL_VERSION_SSPI
(int)
|
基于 Windows SSPI 编译。 自 PHP 7.3.0 和 cURL 7.13.2 起可用 |
CURL_VERSION_TLSAUTH_SRP
(int)
|
TLS-SRP 身份验证支持。自 PHP 7.3.0 和 cURL 7.21.4 起可用 |
CURL_VERSION_UNICODE
(int)
|
自 PHP 8.2.0 和 cURL 7.72.0 起可用 |
CURL_VERSION_UNIX_SOCKETS
(int)
|
Unix 域套接字支持。自 PHP 7.0.7 和 cURL 7.40.0 起可用 |
CURL_VERSION_ZSTD
(int)
|
自 PHP 8.2.0 和 cURL 7.72.0 起可用 |
CURL_WRITEFUNC_PAUSE
(int)
|
自 cURL 7.18.0 起可用。 |
CURL_PREREQFUNC_OK
(int)
|
自 PHP 8.4.0 和 cURL 7.80.0 起可用。 |
CURL_PREREQFUNC_ABORT
(int)
|
自 PHP 8.4.0 和 cURL 7.80.0 起可用。 |
常量 | 描述 | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CURLOPT_ABSTRACT_UNIX_SOCKET
(int)
|
允许使用抽象 Unix 域套接字而不是与主机建立 TCP 连接,并将路径设置为指定 string。此选项与
|
||||||||||||||||
CURLOPT_ACCEPT_ENCODING
(int)
|
设置 string,其中包含 HTTP 请求中发送的 |
||||||||||||||||
CURLOPT_ACCEPTTIMEOUT_MS
(int)
|
使用活跃 FTP 连接时等待服务器连接回 cURL 的最大毫秒数。此选项接受任何可以转换为有效 int
的值。默认为 |
||||||||||||||||
CURLOPT_ADDRESS_SCOPE
(int)
|
连接到 IPv6 地址时使用的范围 ID 值。此选项接受任何可以转换为有效 int
的值。默认为 |
||||||||||||||||
CURLOPT_ALTSVC
(int)
|
传递 string,其中包含 cURL 的文件名,用作 Alt-Svc 缓存文件,从中读取现有缓存内容,并可能在传输后将其写回,除非通过
|
||||||||||||||||
CURLOPT_ALTSVC_CTRL
(int)
|
Populate the bitmask with the correct set of features to instruct cURL how to handle Alt-Svc for the
transfers using this handle. cURL only accepts Alt-Svc headers over HTTPS. It will also only complete
a request to an alternative origin if that origin is properly hosted over HTTPS.
Setting any bit will enable the alt-svc engine.
Set to any of the
|
||||||||||||||||
CURLOPT_APPEND
(int)
|
Setting this option to |
||||||||||||||||
CURLOPT_AUTOREFERER
(int)
|
|
||||||||||||||||
CURLOPT_AWS_SIGV4
(int)
|
Provides AWS V4 signature authentication on HTTP(S) header as a string.
This option overrides any other authentication types that have been set in
|
||||||||||||||||
CURLOPT_BINARYTRANSFER
(int)
|
This constant is no longer used as of PHP 5.5.0. Deprecated as of PHP 8.4.0. |
||||||||||||||||
CURLOPT_BUFFERSIZE
(int)
|
每次读取要使用的缓冲区大小。但不能保证此请求一定会得到满足。此选项接受任何可以转换为有效 int
的值。默认为 |
||||||||||||||||
CURLOPT_CAINFO
(int)
|
包含一个或多个证书的文件名称的string,用于验证对等方。这仅在与
|
||||||||||||||||
CURLOPT_CAINFO_BLOB
(int)
|
A string with the name of a PEM file holding one or more certificates to verify the
peer with. This option overrides |
||||||||||||||||
CURLOPT_CAPATH
(int)
|
A string with a directory that holds multiple CA certificates.
Use this option alongside |
||||||||||||||||
CURLOPT_CA_CACHE_TIMEOUT
(int)
|
Sets the maximum time in seconds any in memory cached CA certificate store
may be kept and reused for new connections.
This option accepts any value that can be cast to a valid int.
Defaults to |
||||||||||||||||
CURLOPT_CERTINFO
(int)
|
|
||||||||||||||||
CURLOPT_CONNECTTIMEOUT
(int)
|
在尝试连接时等待的秒数。设置为 0,则无限等待。此选项接受任何可以转换为有效 int
的值。默认 |
||||||||||||||||
CURLOPT_CONNECTTIMEOUT_MS
(int)
|
尝试连接等待的时间,以毫秒为单位。设置为 |
||||||||||||||||
CURLOPT_CONNECT_ONLY
(int)
|
|
||||||||||||||||
CURLOPT_CONNECT_TO
(int)
|
连接到指定主机和端口,从而替换 URL 中的主机和端口。接受 string 格式的
array: |
||||||||||||||||
CURLOPT_COOKIE
(int)
|
包含 HTTP 请求中使用的 |
||||||||||||||||
CURLOPT_COOKIEFILE
(int)
|
包含 cookie 数据的文件的名称 string。cookie 文件可以是 Netscape 格式,也可以只是转储到文件中的纯 HTTP 样式标头。如果名称为空 string,则不会加载任何 cookie,但仍启用 cookie 处理。自 cURL 7.1.0 起可用。 |
||||||||||||||||
CURLOPT_COOKIEJAR
(int)
|
string,包含调用句柄的析构函数时用于保存所有内部 cookie 的文件的名称。自 cURL 7.9.0 起可用。 警告
自 PHP 8.0.0 起,curl_close() 为空操作(什么都不做),不会销毁句柄。如果需要在句柄自动销毁之前写入 cookie,在句柄上调用 unset()。 |
||||||||||||||||
CURLOPT_COOKIELIST
(int)
|
cookie string(即 Netscape/Mozilla 的单行格式,或常规 HTTP 样式的 Set-Cookie header)将单个
cookie 添加到内部 cookie 存储中。
|
||||||||||||||||
CURLOPT_COOKIESESSION
(int)
|
设为 |
||||||||||||||||
CURLOPT_CRLF
(int)
|
|
||||||||||||||||
CURLOPT_CRLFILE
(int)
|
Pass a string naming a file with the concatenation of
CRL (Certificate Revocation List) (in PEM format)
to use in the certificate validation that occurs during the SSL exchange.
When cURL is built to use GnuTLS,
there is no way to influence the use of CRL passed
to help in the verification process.
When cURL is built with OpenSSL support,
|
||||||||||||||||
CURLOPT_CUSTOMREQUEST
(int)
|
HTTP 请求时,使用自定义的请求方法来代替
|
||||||||||||||||
CURLOPT_DEFAULT_PROTOCOL
(int)
|
URL 缺少协议的时候,使用 string 格式的默认协议。自 PHP 7.0.7 和 cURL 7.45.0 起可用。 |
||||||||||||||||
CURLOPT_DIRLISTONLY
(int)
|
Setting this option to |
||||||||||||||||
CURLOPT_DISALLOW_USERNAME_IN_URL
(int)
|
|
||||||||||||||||
CURLOPT_DNS_CACHE_TIMEOUT
(int)
|
设置在内存中缓存 DNS 的时间,默认为 |
||||||||||||||||
CURLOPT_DNS_INTERFACE
(int)
|
Set the name of the network interface that the DNS resolver should bind to.
This must be an interface name (not an address).
This option accepts a string or |
||||||||||||||||
CURLOPT_DNS_LOCAL_IP4
(int)
|
Set the local IPv4 address that the resolver should bind to.
The argument should contain a single numerical IPv4 address.
This option accepts a string or |
||||||||||||||||
CURLOPT_DNS_LOCAL_IP6
(int)
|
Set the local IPv6 address that the resolver should bind to.
The argument should contain a single numerical IPv6 address.
This option accepts a string or |
||||||||||||||||
CURLOPT_DNS_SERVERS
(int)
|
Pass a string with a comma-separated list of DNS servers to be used
instead of the system default
(e.g.: |
||||||||||||||||
CURLOPT_DNS_SHUFFLE_ADDRESSES
(int)
|
|
||||||||||||||||
CURLOPT_DNS_USE_GLOBAL_CACHE
(int)
|
|
||||||||||||||||
CURLOPT_DOH_SSL_VERIFYHOST
(int)
|
Set to |
||||||||||||||||
CURLOPT_DOH_SSL_VERIFYPEER
(int)
|
Set to |
||||||||||||||||
CURLOPT_DOH_SSL_VERIFYSTATUS
(int)
|
Set to |
||||||||||||||||
CURLOPT_DOH_URL
(int)
|
Provides the DNS-over-HTTPS URL.
This option accepts a string or |
||||||||||||||||
CURLOPT_EGDSOCKET
(int)
|
Like |
||||||||||||||||
CURLOPT_ENCODING
(int)
|
The contents of the |
||||||||||||||||
CURLOPT_EXPECT_100_TIMEOUT_MS
(int)
|
|
||||||||||||||||
CURLOPT_FAILONERROR
(int)
|
当 HTTP 状态码大于等于 |
||||||||||||||||
CURLOPT_FILE
(int)
|
Accepts a file handle resource
to the file that the transfer should be written to.
The default is |
||||||||||||||||
CURLOPT_FILETIME
(int)
|
设置为 |
||||||||||||||||
CURLOPT_FNMATCH_FUNCTION
(int)
|
Pass a callable that will be used for wildcard matching. The signature of the callback should be:
CURL_FNMATCHFUNC_MATCH if pattern matches the string,
CURL_FNMATCHFUNC_NOMATCH if not
or CURL_FNMATCHFUNC_FAIL if an error occurred.
Available as of cURL 7.21.0.
|
||||||||||||||||
CURLOPT_FOLLOWLOCATION
(int)
|
设置为 |
||||||||||||||||
CURLOPT_FORBID_REUSE
(int)
|
设置为 |
||||||||||||||||
CURLOPT_FRESH_CONNECT
(int)
|
设置为 |
||||||||||||||||
CURLOPT_FTPAPPEND
(int)
|
设置为 |
||||||||||||||||
CURLOPT_FTPASCII
(int)
|
|
||||||||||||||||
CURLOPT_FTPLISTONLY
(int)
|
设置为 |
||||||||||||||||
CURLOPT_FTPPORT
(int)
|
A string which will be used to get the IP address to use for the FTP |
||||||||||||||||
CURLOPT_FTPSSLAUTH
(int)
|
将 FTP over SSL 身份验证方法(如果已启用)设置为任何 |
||||||||||||||||
CURLOPT_FTP_ACCOUNT
(int)
|
Pass a string that will be sent as account information over FTP
(using the |
||||||||||||||||
CURLOPT_FTP_ALTERNATIVE_TO_USER
(int)
|
Pass a string that will be used to try to authenticate over FTP
if the |
||||||||||||||||
CURLOPT_FTP_CREATE_MISSING_DIRS
(int)
|
设置为 |
||||||||||||||||
CURLOPT_FTP_FILEMETHOD
(int)
|
Tell cURL which method to use to reach a file on a FTP(S) server. Possible values are
any of the |
||||||||||||||||
CURLOPT_FTP_RESPONSE_TIMEOUT
(int)
|
A timeout in seconds cURL will wait for a response from an FTP server.
This option overrides |
||||||||||||||||
CURLOPT_FTP_SKIP_PASV_IP
(int)
|
If this option is set to |
||||||||||||||||
CURLOPT_FTP_SSL
(int)
|
Available as of cURL 7.11.0 and deprecated as of cURL 7.16.4. |
||||||||||||||||
CURLOPT_FTP_SSL_CCC
(int)
|
This option makes cURL use CCC (Clear Command Channel)
which shuts down the SSL/TLS layer after authenticating
making the rest of the control channel communication unencrypted.
Use one of the |
||||||||||||||||
CURLOPT_FTP_USE_EPRT
(int)
|
设置为 |
||||||||||||||||
CURLOPT_FTP_USE_EPSV
(int)
|
设置为 |
||||||||||||||||
CURLOPT_FTP_USE_PRET
(int)
|
Set to |
||||||||||||||||
CURLOPT_GSSAPI_DELEGATION
(int)
|
Set to |
||||||||||||||||
CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS
(int)
|
Head start for IPv6 for the happy eyeballs algorithm. Happy eyeballs attempts
to connect to both IPv4 and IPv6 addresses for dual-stack hosts,
preferring IPv6 first for timeout milliseconds.
Defaults to |
||||||||||||||||
CURLOPT_HAPROXYPROTOCOL
(int)
|
|
||||||||||||||||
CURLOPT_HEADER
(int)
|
设置为 |
||||||||||||||||
CURLOPT_HEADERFUNCTION
(int)
|
A callable with the following signature:
|
||||||||||||||||
CURLOPT_HEADEROPT
(int)
|
将 HTTP header 同时发送到代理和主机或单独发送。可能的值是 |
||||||||||||||||
CURLOPT_HSTS
(int)
|
string with HSTS (HTTP Strict Transport Security) cache file name
or |
||||||||||||||||
CURLOPT_HSTS_CTRL
(int)
|
Accepts a bitmask of HSTS (HTTP Strict Transport Security) features
defined by the |
||||||||||||||||
CURLOPT_HTTP09_ALLOWED
(int)
|
是否允许 HTTP/0.9 响应。从 cURL 7.66.0 起默认为 |
||||||||||||||||
CURLOPT_HTTP200ALIASES
(int)
|
An array of HTTP |
||||||||||||||||
CURLOPT_HTTPAUTH
(int)
|
使用的 HTTP 验证方法。选项有:
|
||||||||||||||||
CURLOPT_HTTPGET
(int)
|
设置为 |
||||||||||||||||
CURLOPT_HTTPHEADER
(int)
|
An array of HTTP header fields to set, in the format
|
||||||||||||||||
CURLOPT_HTTPPROXYTUNNEL
(int)
|
|
||||||||||||||||
CURLOPT_HTTP_CONTENT_DECODING
(int)
|
|
||||||||||||||||
CURLOPT_HTTP_TRANSFER_DECODING
(int)
|
If set to |
||||||||||||||||
CURLOPT_HTTP_VERSION
(int)
|
设置为 |
||||||||||||||||
CURLOPT_IGNORE_CONTENT_LENGTH
(int)
|
If set to |
||||||||||||||||
CURLOPT_INFILE
(int)
|
Accepts a file handle resource
to the file that the transfer should be read from when uploading.
Available as of cURL 7.1.0 and deprecated as of cURL 7.9.7.
Use |
||||||||||||||||
CURLOPT_INFILESIZE
(int)
|
希望传给远程站点的文件字节大小。注意无法用这个选项阻止 cURL 发送更多的数据,确切发送什么取决于
|
||||||||||||||||
CURLOPT_INTERFACE
(int)
|
Set to a string with the name of the outgoing network interface to use. This can be an interface name, an IP address or a host name. Available as of cURL 7.1.0. |
||||||||||||||||
CURLOPT_IPRESOLVE
(int)
|
允许应用程序选择在解析主机名时使用哪种 IP 地址。这仅在使用解析使用多个 IP 版本的地址的主机名时才有意义。设置为
|
||||||||||||||||
CURLOPT_ISSUERCERT
(int)
|
If set to a string naming a file holding a CA certificate in PEM format,
an additional check against the peer certificate is performed
to verify the issuer is indeed the one associated
with the certificate provided by the option.
For the result of the check to be considered a failure,
this option should be used in combination with the
|
||||||||||||||||
CURLOPT_ISSUERCERT_BLOB
(int)
|
Pass a string with binary data of a CA SSL certificate in PEM format. If set, an additional check against the peer certificate is performed to verify the issuer is the one associated with the certificate provided by the option. Available as of PHP 8.1.0 and cURL 7.71.0. |
||||||||||||||||
CURLOPT_KEEP_SENDING_ON_ERROR
(int)
|
设置为 |
||||||||||||||||
CURLOPT_KEYPASSWD
(int)
|
Set to a string with the password required to use the |
||||||||||||||||
CURLOPT_KRB4LEVEL
(int)
|
The KRB4 (Kerberos 4) security level. Any of the following string values
(in order from least to most powerful) are valid:
|
||||||||||||||||
CURLOPT_KRBLEVEL
(int)
|
Set the kerberos security level for FTP and also enables kerberos awareness.
This should be set to one of the following strings:
|
||||||||||||||||
CURLOPT_LOCALPORT
(int)
|
Sets the local port number of the socket used for the connection.
This option accepts any value that can be cast to a valid int.
Defaults to |
||||||||||||||||
CURLOPT_LOCALPORTRANGE
(int)
|
The number of attempts cURL makes to find a working local port number,
starting with the one set with |
||||||||||||||||
CURLOPT_LOGIN_OPTIONS
(int)
|
Can be used to set protocol specific login options, such as the
preferred authentication mechanism via |
||||||||||||||||
CURLOPT_LOW_SPEED_LIMIT
(int)
|
传输速度,每秒字节数,根据 |
||||||||||||||||
CURLOPT_LOW_SPEED_TIME
(int)
|
当传输速度小于 |
||||||||||||||||
CURLOPT_MAIL_AUTH
(int)
|
Set a string with the authentication address (identity)
of a submitted message that is being relayed to another server.
The address should not be specified within a pair of angled brackets
( |
||||||||||||||||
CURLOPT_MAIL_FROM
(int)
|
Set a string with the sender's email address when sending SMTP mail.
The email address should be specified with angled brackets
( |
||||||||||||||||
CURLOPT_MAIL_RCPT
(int)
|
Set to an array of strings
with the recipients to pass to the server in an SMTP mail request.
Each recipient should be specified within a pair of angled brackets
( |
||||||||||||||||
CURLOPT_MAIL_RCPT_ALLLOWFAILS
(int)
|
设置为 |
||||||||||||||||
CURLOPT_MAXAGE_CONN
(int)
|
重新使用已存在连接时允许的最大空闲时间。默认最大时间设置为 |
||||||||||||||||
CURLOPT_MAXCONNECTS
(int)
|
允许的最大持久连接数。当达到限制时,将会关闭缓存中最早的连接,以防止增加已打开的连接数。此选项接受任何可以转换为有效 int 的值。自 cURL 7.7.0 起可用。 |
||||||||||||||||
CURLOPT_MAXFILESIZE
(int)
|
Sets the maximum accepted size (in bytes) of a file to download.
If the file requested is found larger than this value,
the transfer is aborted
and |
||||||||||||||||
CURLOPT_MAXFILESIZE_LARGE
(int)
|
The maximum file size in bytes allowed to download. If the file requested is found larger than this value,
the transfer will not start and |
||||||||||||||||
CURLOPT_MAXLIFETIME_CONN
(int)
|
The maximum time in seconds, since the creation of the connection, that is allowed for an existing
connection to have for it to be considered for reuse. If a connection is found in the cache that is older
than this value, it will instead be closed once any in-progress transfers are complete.
Default is |
||||||||||||||||
CURLOPT_MAXREDIRS
(int)
|
指定最多的 HTTP 重定向次数,这个选项是和 |
||||||||||||||||
CURLOPT_MAX_RECV_SPEED_LARGE
(int)
|
如果下载速度超过了此速度(以每秒字节数来统计),即传输过程中累计的平均数,传输就会降速到这个参数的值。默认不限速。 This option accepts any value that can be cast to a valid int. Available as of cURL 7.15.5. |
||||||||||||||||
CURLOPT_MAX_SEND_SPEED_LARGE
(int)
|
如果上传的速度超过了此速度(以每秒字节数来统计),即传输过程中累计的平均数,传输就会降速到这个参数的值。默认不限速。 This option accepts any value that can be cast to a valid int. Available as of cURL 7.15.5. |
||||||||||||||||
CURLOPT_MIME_OPTIONS
(int)
|
Set to a bitmask of |
||||||||||||||||
CURLOPT_MUTE
(int)
|
设置 |
||||||||||||||||
CURLOPT_NETRC
(int)
|
设置为 |
||||||||||||||||
CURLOPT_NETRC_FILE
(int)
|
Set a string containing the full path name to a |
||||||||||||||||
CURLOPT_NEW_DIRECTORY_PERMS
(int)
|
Sets the value of the permissions (int) that is set on newly created directories
on the remote server. The default value is |
||||||||||||||||
CURLOPT_NEW_FILE_PERMS
(int)
|
Sets the value of the permissions (as an int) that are set on newly created files
on the remote server. The default value is |
||||||||||||||||
CURLOPT_NOBODY
(int)
|
设置为 |
||||||||||||||||
CURLOPT_NOPROGRESS
(int)
|
设置为 自 cURL 7.1.0 起可用。 |
||||||||||||||||
CURLOPT_NOPROXY
(int)
|
Set a string consisting of a comma separated list of hostnames
that do not require a proxy to get reached.
Each name in this list is matched as either a domain
which contains the hostname or the hostname itself.
The only wildcard available in the string
is a single |
||||||||||||||||
CURLOPT_NOSIGNAL
(int)
|
|
||||||||||||||||
CURLOPT_PASSWDFUNCTION
(int)
|
A callable with the following signature:
|
||||||||||||||||
CURLOPT_PASSWORD
(int)
|
Set to a string with the password to use in authentication. Available as of cURL 7.19.1. |
||||||||||||||||
CURLOPT_PATH_AS_IS
(int)
|
Set to |
||||||||||||||||
CURLOPT_PINNEDPUBLICKEY
(int)
|
Set a string with the pinned public key.
The string can be the file name of the pinned public key
in a PEM or DER file format. The string can also be any
number of base64 encoded sha256 hashes preceded by |
||||||||||||||||
CURLOPT_PIPEWAIT
(int)
|
Set to |
||||||||||||||||
CURLOPT_PORT
(int)
|
An int with an alternative port number to connect to instead of the one specified in the URL or the default port for the used protocol. Available as of cURL 7.1.0. |
||||||||||||||||
CURLOPT_POST
(int)
|
设置为 |
||||||||||||||||
CURLOPT_POSTFIELDS
(int)
|
The full data to post in a HTTP |
||||||||||||||||
CURLOPT_POSTQUOTE
(int)
|
An array of FTP command strings to execute on the server after the FTP request has been performed. Available as of cURL 7.1.0. |
||||||||||||||||
CURLOPT_POSTREDIR
(int)
|
位掩码, |
||||||||||||||||
CURLOPT_PRE_PROXY
(int)
|
Set a string holding the host name or dotted numerical
IP address to be used as the preproxy that cURL connects to before
it connects to the HTTP(S) proxy specified in the
|
||||||||||||||||
CURLOPT_PREQUOTE
(int)
|
Set an array of FTP command strings to pass to the server after the transfer type is set. These commands are not performed when a directory listing is performed, only for file transfers. Available as of cURL 7.9.5. |
||||||||||||||||
CURLOPT_PRIVATE
(int)
|
Any data that should be associated with this cURL handle. This data
can subsequently be retrieved with the
|
||||||||||||||||
CURLOPT_PROGRESSFUNCTION
(int)
|
A callable with the following signature:
callback(
resource $curlHandle ,int $bytesToDownload ,int $bytesDownloaded ,int $bytesToUpload ,int $bytesUploaded ): int
CURLE_ABORTED_BY_CALLBACK error.
Available as of cURL 7.1.0 and deprecated as of cURL 7.32.0. Use CURLOPT_XFERINFOFUNCTION instead.
|
||||||||||||||||
CURLOPT_PROTOCOLS
(int)
|
Bitmask of |
||||||||||||||||
CURLOPT_PROTOCOLS_STR
(int)
|
Set to a string with a comma separated list
of case insensitive protocol names (URL schemes) to allow in the transfer.
Set to |
||||||||||||||||
CURLOPT_PROXY
(int)
|
A string with the HTTP proxy to tunnel requests through. This should be the hostname, the dotted numerical IP address or a numerical IPv6 address written within [brackets]. Available as of cURL 7.1.0. |
||||||||||||||||
CURLOPT_PROXYAUTH
(int)
|
A bitmask of the HTTP authentication method(s)
( |
||||||||||||||||
CURLOPT_PROXYHEADER
(int)
|
An array of custom HTTP header strings to pass to proxies. Available as of PHP 7.0.7 and cURL 7.37.0. |
||||||||||||||||
CURLOPT_PROXYPASSWORD
(int)
|
Set a string with the password to be used for authentication with the proxy. Available as of cURL 7.19.1. |
||||||||||||||||
CURLOPT_PROXYPORT
(int)
|
An int with the port number of the proxy to connect to.
This port number can also be set in |
||||||||||||||||
CURLOPT_PROXYTYPE
(int)
|
Sets the type of the proxy to one of the
|
||||||||||||||||
CURLOPT_PROXYUSERNAME
(int)
|
Set a string with the username to be used for authentication with the proxy. Available as of cURL 7.19.1. |
||||||||||||||||
CURLOPT_PROXYUSERPWD
(int)
|
A string with a username and password formatted as
|
||||||||||||||||
CURLOPT_PROXY_CAINFO
(int)
|
The path to proxy Certificate Authority (CA) bundle. Set the path as a string naming a file holding one or more certificates to verify the HTTPS proxy with. This option is for connecting to an HTTPS proxy, not an HTTPS server. Defaults set to the system path where cURL's cacert bundle is assumed to be stored. Available as of PHP 7.3.0 and cURL 7.52.0. |
||||||||||||||||
CURLOPT_PROXY_CAINFO_BLOB
(int)
|
A string with the name of a PEM file holding one or more certificates to verify the HTTPS proxy with. This option is for connecting to an HTTPS proxy, not an HTTPS server. Defaults set to the system path where cURL's cacert bundle is assumed to be stored. Available as of PHP 8.2.0 and cURL 7.77.0. |
||||||||||||||||
CURLOPT_PROXY_CAPATH
(int)
|
A string with the directory holding multiple CA certificates to verify the HTTPS proxy with. Available as of PHP 7.3.0 and cURL 7.52.0. |
||||||||||||||||
CURLOPT_PROXY_CRLFILE
(int)
|
Set to a string with the file name with the concatenation of CRL (Certificate Revocation List) in PEM format to use in the certificate validation that occurs during the SSL exchange. Available as of PHP 7.3.0 and cURL 7.52.0. |
||||||||||||||||
CURLOPT_PROXY_ISSUERCERT
(int)
|
Proxy issuer SSL certificate filename string. Available as of PHP 8.1.0 and cURL 7.71.0. |
||||||||||||||||
CURLOPT_PROXY_ISSUERCERT_BLOB
(int)
|
A string with the proxy issuer SSL certificate. Available as of PHP 8.1.0 and cURL 7.71.0. |
||||||||||||||||
CURLOPT_PROXY_KEYPASSWD
(int)
|
Set the string be used as the password required to use the
|
||||||||||||||||
CURLOPT_PROXY_PINNEDPUBLICKEY
(int)
|
Set the pinned public key for HTTPS proxy.
The string can be the file name of the pinned public key
which is expected to be in a |
||||||||||||||||
CURLOPT_PROXY_SERVICE_NAME
(int)
|
A string with the proxy authentication service name. Available as of PHP 7.0.7, cURL 7.43.0 (for HTTP proxies) and cURL 7.49.0 (for SOCKS5 proxies). |
||||||||||||||||
CURLOPT_PROXY_SSLCERT
(int)
|
A string with the file name of the client certificate used to connect to the HTTPS proxy.
The default format is |
||||||||||||||||
CURLOPT_PROXY_SSLCERTTYPE
(int)
|
A string with the format of the client certificate used when connecting to an HTTPS proxy.
Supported formats are |
||||||||||||||||
CURLOPT_PROXY_SSLCERT_BLOB
(int)
|
A string with the SSL proxy client certificate. Available as of PHP 8.1.0 and cURL 7.71.0. |
||||||||||||||||
CURLOPT_PROXY_SSLKEY
(int)
|
A string with the file name of the private key
used for connecting to the HTTPS proxy.
The default format is |
||||||||||||||||
CURLOPT_PROXY_SSLKEYTYPE
(int)
|
A string with the format of the private key.
Supported formats are:
|
||||||||||||||||
CURLOPT_PROXY_SSLKEY_BLOB
(int)
|
A string with the private key for connecting to the HTTPS proxy. Available as of PHP 8.1.0 and cURL 7.71.0. |
||||||||||||||||
CURLOPT_PROXY_SSLVERSION
(int)
|
Set the preferred HTTPS proxy TLS version to one of the
警告
Available as of PHP 7.3.0 and cURL 7.52.0.
最好不要设置此选项并使用默认的 |
||||||||||||||||
CURLOPT_PROXY_SSL_CIPHER_LIST
(int)
|
A string with a colon-separated list of ciphers
to use for the connection to the HTTPS proxy.
When used with OpenSSL commas and spaces are also acceptable as separators,
and |
||||||||||||||||
CURLOPT_PROXY_SSL_OPTIONS
(int)
|
Set proxy SSL behavior options, which is a bitmask of the
|
||||||||||||||||
CURLOPT_PROXY_SSL_VERIFYHOST
(int)
|
设置为 |
||||||||||||||||
CURLOPT_PROXY_SSL_VERIFYPEER
(int)
|
|
||||||||||||||||
CURLOPT_PROXY_TLS13_CIPHERS
(int)
|
A string with a colon-separated list of ciphers to use for the connection to the TLS 1.3 connection to a proxy.
This option is currently used only when cURL is built to use OpenSSL 1.1.1 or later.
When using a different SSL backend the TLS 1.3 cipher suites can be set
with the |
||||||||||||||||
CURLOPT_PROXY_TLSAUTH_PASSWORD
(int)
|
A string with the password to use for the TLS authentication method specified with the
|
||||||||||||||||
CURLOPT_PROXY_TLSAUTH_TYPE
(int)
|
The method of the TLS authentication used for the HTTPS connection.
Supported method is Available as of PHP 7.3.0 and cURL 7.52.0. |
||||||||||||||||
CURLOPT_PROXY_TLSAUTH_USERNAME
(int)
|
The username to use for the HTTPS proxy TLS authentication method specified with the
|
||||||||||||||||
CURLOPT_PROXY_TRANSFER_MODE
(int)
|
Set to |
||||||||||||||||
CURLOPT_PUT
(int)
|
|
||||||||||||||||
CURLOPT_QUICK_EXIT
(int)
|
Set to |
||||||||||||||||
CURLOPT_QUOTE
(int)
|
An array of FTP command strings to execute on the server prior to the FTP request. Available as of cURL 7.1.0. |
||||||||||||||||
CURLOPT_RANDOM_FILE
(int)
|
A string with a filename to be used to seed the random number generator for SSL. Available as of cURL 7.7.0 and deprecated as of cURL 7.84.0. |
||||||||||||||||
CURLOPT_RANGE
(int)
|
A string with the range(s) of data to retrieve in the format |
||||||||||||||||
CURLOPT_READDATA
(int)
|
Sets a file pointer resource that will be used by the file read function
set with |
||||||||||||||||
CURLOPT_READFUNCTION
(int)
|
A callable with the following signature:
EOF .
Available as of cURL 7.1.0.
|
||||||||||||||||
CURLOPT_REDIR_PROTOCOLS
(int)
|
Bitmask of |
||||||||||||||||
CURLOPT_REDIR_PROTOCOLS_STR
(int)
|
Set to a string with a comma separated list
of case insensitive protocol names (URL schemes)
to allow to follow to in a redirect when
|
||||||||||||||||
CURLOPT_REFERER
(int)
|
A string with the contents of the |
||||||||||||||||
CURLOPT_REQUEST_TARGET
(int)
|
A string to use in the upcoming request instead of the path as extracted from the URL. Available as of PHP 7.3.0 and cURL 7.55.0. |
||||||||||||||||
CURLOPT_RESOLVE
(int)
|
Provide an array of colon-separated strings
with custom addresses for specific host and port pairs in the following format:
|
||||||||||||||||
CURLOPT_RESUME_FROM
(int)
|
恢复传输时,传递字节为单位的偏移量(以字节为单位)。此选项接受任何可以转换为有效 int 的值。自 cURL 7.1.0 起可用。 |
||||||||||||||||
CURLOPT_RETURNTRANSFER
(int)
|
|
||||||||||||||||
CURLOPT_RTSP_CLIENT_CSEQ
(int)
|
Set an int with the CSEQ number to issue for the next RTSP request.
Useful if the application is resuming a previously broken connection.
The CSEQ increments from this new number henceforth.
Defaults to |
||||||||||||||||
CURLOPT_RTSP_REQUEST
(int)
|
Sets the kind of RTSP request to make.
Must be one of the |
||||||||||||||||
CURLOPT_RTSP_SERVER_CSEQ
(int)
|
Set an int with the CSEQ number to expect
for the next RTSP Server to Client request.
This feature (listening for Server requests) is unimplemented.
Defaults to |
||||||||||||||||
CURLOPT_RTSP_SESSION_ID
(int)
|
Set a string with the value of the current RTSP Session ID for the handle.
Once this value is set to any non- |
||||||||||||||||
CURLOPT_RTSP_STREAM_URI
(int)
|
Sets a string with the stream URI to operate on.
If not set, cURL defaults to operating on generic server options
by passing |
||||||||||||||||
CURLOPT_RTSP_TRANSPORT
(int)
|
Set the |
||||||||||||||||
CURLOPT_SAFE_UPLOAD
(int)
|
始终为 |
||||||||||||||||
CURLOPT_SASL_AUTHZID
(int)
|
The authorization identity (authzid) string for the transfer. Only applicable to the PLAIN SASL authentication mechanism where it is optional. When not specified, only the authentication identity (authcid) as specified by the username will be sent to the server, along with the password. The server will derive the authzid from the authcid when not provided, which it will then use internally. Available as of PHP 8.2.0 and cURL 7.66.0. |
||||||||||||||||
CURLOPT_SASL_IR
(int)
|
|
||||||||||||||||
CURLOPT_SERVICE_NAME
(int)
|
A string with the authentication service name. Available as of PHP 7.0.7 and cURL 7.43.0. |
||||||||||||||||
CURLOPT_SHARE
(int)
|
curl_share_init() 的结果。使 cURL 可以使用共享句柄中的数据。自 cURL 7.10 起可用。 |
||||||||||||||||
CURLOPT_SOCKS5_AUTH
(int)
|
用于 SOCKS5 验证方法。选项是:
|
||||||||||||||||
CURLOPT_SOCKS5_GSSAPI_NEC
(int)
|
Set to |
||||||||||||||||
CURLOPT_SOCKS5_GSSAPI_SERVICE
(int)
|
Set a string holding the name of the SOCKS5 service.
Defaults to |
||||||||||||||||
CURLOPT_SSH_AUTH_TYPES
(int)
|
A bitmask consisting of one or more of the following constants:
|
||||||||||||||||
CURLOPT_SSH_COMPRESSION
(int)
|
|
||||||||||||||||
CURLOPT_SSH_HOSTKEYFUNCTION
(int)
|
A callable that will be called when SSH host key verification is needed. The callback must have the following signature:
CURLOPT_SSH_KNOWNHOSTS .
Available as of PHP 8.3.0 and cURL 7.84.0.
|
||||||||||||||||
CURLOPT_SSH_HOST_PUBLIC_KEY_MD5
(int)
|
A string containing 32 hexadecimal digits which should contain the MD5 checksum of the remote host's public key, and cURL will reject the connection to the host unless the md5sums match. This option is only for SCP and SFTP transfers. Available as of cURL 7.17.1. |
||||||||||||||||
CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256
(int)
|
A string with the base64-encoded SHA256 hash of the remote host's public key. The transfer will fail if the given hash does not match the hash the remote host provides. Available as of PHP 8.2.0 and cURL 7.80.0. |
||||||||||||||||
CURLOPT_SSH_KNOWNHOSTS
(int)
|
设置为要使用的 known_host 文件的文件名,该文件应使用 libssh2 支持的 OpenSSH 文件格式。自 cURL 7.19.6 起可用。 |
||||||||||||||||
CURLOPT_SSH_PRIVATE_KEYFILE
(int)
|
私钥的文件名。如果未指定,cURL 会默认使用 $HOME/.ssh/id_dsa(如果设置了 HOME
环境变量的话),或者在 HOME 未设置的情况下,默认使用当前目录下的 |
||||||||||||||||
CURLOPT_SSH_PUBLIC_KEYFILE
(int)
|
公钥的文件名。如果未指定,cURL 会默认使用 $HOME/.ssh/id_dsa.pub(如果设置了 HOME
环境变量的话),或者在 HOME 未设置的情况下,默认使用当前目录下的 |
||||||||||||||||
CURLOPT_SSLCERT
(int)
|
包含 PEM 格式证书的文件名称。自 cURL 7.1.0 起可用。 |
||||||||||||||||
CURLOPT_SSLCERTPASSWD
(int)
|
使用 |
||||||||||||||||
CURLOPT_SSLCERTTYPE
(int)
|
string 的证书格式。支持的格式有:
|
||||||||||||||||
CURLOPT_SSLCERT_BLOB
(int)
|
包含 SSL 客户端证书的 string。自 PHP 8.1.0 和 cURL 7.71.0 起可用。 |
||||||||||||||||
CURLOPT_SSLENGINE
(int)
|
|
||||||||||||||||
CURLOPT_SSLENGINE_DEFAULT
(int)
|
加密引擎的 string 标识符,用于非对称加密操作。自 cURL 7.9.3 起可用。 |
||||||||||||||||
CURLOPT_SSLKEY
(int)
|
包含私有 SSL 密钥的文件名。自 cURL 7.9.3 起可用。 |
||||||||||||||||
CURLOPT_SSLKEYPASSWD
(int)
|
使用 自 cURL 7.9.3 起可用并且自 cURL 7.17.0 起弃用。 |
||||||||||||||||
CURLOPT_SSLKEYTYPE
(int)
|
|
||||||||||||||||
CURLOPT_SSLKEY_BLOB
(int)
|
客户端证书的 string 私钥。自 PHP 8.1.0 和 cURL 7.71.0 起可用。 |
||||||||||||||||
CURLOPT_SSLVERSION
(int)
|
警告
默认为
最好不要设置此选项并使用默认值。因为考虑到 SSLv2 和 SSLv3 中已知的漏洞,将其设置为
CURL_SSLVERSION_DEFAULT 。自 cURL 7.1.0 起可用。
|
||||||||||||||||
CURLOPT_SSL_CIPHER_LIST
(int)
|
用于 TLS 1.2(1.1、1.0)连接的以冒号分隔的密码 string。自 cURL 7.9 起可用。 |
||||||||||||||||
CURLOPT_SSL_EC_CURVES
(int)
|
椭圆曲线算法的冒号分隔列表。例如, |
||||||||||||||||
CURLOPT_SSL_ENABLE_ALPN
(int)
|
|
||||||||||||||||
CURLOPT_SSL_ENABLE_NPN
(int)
|
|
||||||||||||||||
CURLOPT_SSL_FALSESTART
(int)
|
|
||||||||||||||||
CURLOPT_SSL_OPTIONS
(int)
|
设置 SSL 行为选项,是 |
||||||||||||||||
CURLOPT_SSL_SESSIONID_CACHE
(int)
|
设置为 |
||||||||||||||||
CURLOPT_SSL_VERIFYHOST
(int)
|
|
||||||||||||||||
CURLOPT_SSL_VERIFYPEER
(int)
|
|
||||||||||||||||
CURLOPT_SSL_VERIFYSTATUS
(int)
|
|||||||||||||||||
CURLOPT_STDERR
(int)
|
接受指向替代位置的文件句柄 resource,以将错误输出到 |
||||||||||||||||
CURLOPT_STREAM_WEIGHT
(int)
|
设置 stream weight 数值( |
||||||||||||||||
CURLOPT_SUPPRESS_CONNECT_HEADERS
(int)
|
当使用 |
||||||||||||||||
CURLOPT_TCP_FASTOPEN
(int)
|
|
||||||||||||||||
CURLOPT_TCP_KEEPALIVE
(int)
|
如果设置为 |
||||||||||||||||
CURLOPT_TCP_KEEPIDLE
(int)
|
设置延迟秒数,如果启用了 |
||||||||||||||||
CURLOPT_TCP_KEEPINTVL
(int)
|
设置间隔(以秒为单位),如果启用了 |
||||||||||||||||
CURLOPT_TCP_KEEPCNT
(int)
|
设置 TCP 保持活动探测的最大数量。默认值为 |
||||||||||||||||
CURLOPT_TCP_NODELAY
(int)
|
|
||||||||||||||||
CURLOPT_TELNETOPTIONS
(int)
|
设置要传递给 telnet 协商的由 string 组成的 array。变量应采用
|
||||||||||||||||
CURLOPT_TFTP_BLKSIZE
(int)
|
设置用于 TFTP 数据传输的块大小。有效范围为 |
||||||||||||||||
CURLOPT_TFTP_NO_OPTIONS
(int)
|
|
||||||||||||||||
CURLOPT_TIMECONDITION
(int)
|
设置如何对待 |
||||||||||||||||
CURLOPT_TIMEOUT
(int)
|
允许 cURL 函数执行的最长秒数。默认值为
|
||||||||||||||||
CURLOPT_TIMEOUT_MS
(int)
|
允许 cURL 允许执行的最长毫秒数。如果 cURL 编译时使用系统标准的名称解析器(standard system name
resolver),那部分的连接仍旧使用以秒计的超时解决方案,最小超时时间还是一秒钟。默认值为
|
||||||||||||||||
CURLOPT_TIMEVALUE
(int)
|
秒数,从 1970 年 1 月 1 日开始。这个时间将由 |
||||||||||||||||
CURLOPT_TIMEVALUE_LARGE
(int)
|
自 1970 年 1 月 1 日以来的秒数。该时间将由 |
||||||||||||||||
CURLOPT_TLS13_CIPHERS
(int)
|
string,包含用于连接到 TLS 1.3 连接的以冒号分隔的密码套件列表。此选项目前仅在 cURL 构建为
OpenSSL 1.1.1 或更高版本时使用。当使用不同的 SSL 后端时,可以使用 |
||||||||||||||||
CURLOPT_TLSAUTH_PASSWORD
(int)
|
设置用于 |
||||||||||||||||
CURLOPT_TLSAUTH_TYPE
(int)
|
设置 TLS 身份验证方法的 string。支持的方法是 |
||||||||||||||||
CURLOPT_TLSAUTH_USERNAME
(int)
|
设置 string,其中包含要用于 |
||||||||||||||||
CURLOPT_TRANSFER_ENCODING
(int)
|
设置为 |
||||||||||||||||
CURLOPT_TRANSFERTEXT
(int)
|
|
||||||||||||||||
CURLOPT_UNIX_SOCKET_PATH
(int)
|
启用时使用 Unix domain socket 作为连接端点,并设置路径为指定 string。设置为 |
||||||||||||||||
CURLOPT_UNRESTRICTED_AUTH
(int)
|
|
||||||||||||||||
CURLOPT_UPKEEP_INTERVAL_MS
(int)
|
某些协议具有“连接维护”机制。这些机制通常会在现有连接上发送一些流量以保持处于活动状态。此选项定义连接维护间隔。目前,唯一具有连接维护机制的协议是
HTTP/2。当超过连接维护间隔时,将在连接上发送 HTTP/2 PING 帧。默认为 |
||||||||||||||||
CURLOPT_UPLOAD
(int)
|
|||||||||||||||||
CURLOPT_UPLOAD_BUFFERSIZE
(int)
|
cURL 上传缓冲区的首选缓冲区字节数。上传缓冲区默认为 64 KB。允许设置的最大缓冲区为 2 MB。允许设置的最小缓冲区为 16 KB。自 PHP 8.2.0 和 cURL 7.62.0 起可用。 |
||||||||||||||||
CURLOPT_URL
(int)
|
要获取的 URL。也可以在 curl_init() 初始化会话时设置。自 cURL 7.1.0 起可用。 |
||||||||||||||||
CURLOPT_USE_SSL
(int)
|
设置使用 FTP、SMTP、POP3、IMAP 等进行传输时所需的 SSL/TLS 级别。这些都是从纯文本开始并使用
STARTTLS 命令“升级”到 SSL 的协议。设置为 |
||||||||||||||||
CURLOPT_USERAGENT
(int)
|
HTTP 请求中 |
||||||||||||||||
CURLOPT_USERNAME
(int)
|
身份验证时使用的用户名。自 cURL 7.19.1 起可用。 |
||||||||||||||||
CURLOPT_USERPWD
(int)
|
用于连接的用户名和密码,格式为 |
||||||||||||||||
CURLOPT_VERBOSE
(int)
|
|
||||||||||||||||
CURLOPT_WILDCARDMATCH
(int)
|
设置为 |
||||||||||||||||
CURLOPT_WRITEFUNCTION
(int)
|
具有以下签名的 callable:
|
||||||||||||||||
CURLOPT_WRITEHEADER
(int)
|
接受文件句柄 resource,将传输的 header 部分写入该文件。自 cURL 7.1.0 起可用。 |
||||||||||||||||
CURLOPT_WS_OPTIONS
(int)
|
接受位掩码设置 WebSocket 行为选项。唯一可用的选项是 |
||||||||||||||||
CURLOPT_XFERINFOFUNCTION
(int)
|
具有以下签名的 callable:
callback(
resource $curlHandle ,int $bytesToDownload ,int $bytesDownloaded ,int $bytesToUpload ,int $bytesUploaded ): int
1 可中止传输并设置 CURLE_ABORTED_BY_CALLBACK 错误。自 PHP 8.2.0 和 cURL 7.32.0 起可用。
|
||||||||||||||||
CURLOPT_SERVER_RESPONSE_TIMEOUT
(int)
|
cURL 将等待来自 FTP、SFTP、IMAP、SCP、SMTP
或 POP3 服务器响应的超时秒数。此选项取代了现有的 |
||||||||||||||||
CURLOPT_XOAUTH2_BEARER
(int)
|
指定 OAuth 2.0 访问 token。设置为 |
||||||||||||||||
CURLOPT_PREREQFUNCTION
(int)
|
具有以下签名的 callable,在建立连接之后但在发送请求负载(例如,HTTP 连接的 GET/POST/DELETE 请求)之前调用,可用于根据源和目标 IP 地址和端口号中止或允许连接:
callback(
CurlHandle $curlHandle ,string $destination_ip ,string $local_ip ,int $destination_port ,int $local_port ): int
CURL_PREREQFUNC_OK 以允许请求,或返回 CURL_PREREQFUNC_ABORT
以中止传输。自 PHP 8.4.0 和 cURL 7.80.0 起可用。
|
||||||||||||||||
CURLOPT_DEBUGFUNCTION
(int)
|
自 PHP 8.4.0 起可用。此选项需要启用
|
常量 | 描述 |
---|---|
CURL_LOCK_DATA_CONNECT
(int)
|
共享/取消共享连接缓存。自 PHP 7.3.0 和 cURL 7.10.0 起可用。 |
CURL_LOCK_DATA_COOKIE
(int)
|
共享/取消共享 cookie 数据。自 cURL 7.10.3 起可用。 |
CURL_LOCK_DATA_DNS
(int)
|
共享/取消共享 DNS 缓存。注意,当使用 cURL 多句柄时,默认情况下添加到同一个多句柄的所有句柄将共享 DNS 缓存。自 cURL 7.10.3 起可用。 |
CURL_LOCK_DATA_PSL
(int)
|
共享/取消共享公共后缀列表。自 PHP 7.3.0 和 cURL 7.61.0 起可用。 |
CURL_LOCK_DATA_SSL_SESSION
(int)
|
共享/取消共享 SSL 的 session ID,从而在重新连接到同一服务器时减少 SSL 握手所需的时间。请注意,默认情况下在同一句柄内会重用 SSL 会话 ID。自 cURL 7.10.3 起可用。 |
CURLSHOPT_NONE
(int)
|
自 cURL 7.10.3 起可用。 |
CURLSHOPT_SHARE
(int)
|
指定应共享的数据类型。自 cURL 7.10.3 起可用。 |
CURLSHOPT_UNSHARE
(int)
|
指定不应共享的数据类型。自 cURL 7.10.3 起可用。 |
常量 | 描述 |
---|---|
CURLINFO_APPCONNECT_TIME
(int)
|
从建立 SSL/SSH 连接/握手起,到与远程主机完成连接所花费的秒数 |
CURLINFO_APPCONNECT_TIME_T
(int)
|
从建立 SSL/SSH 连接/握手起,到与远程主机完成连接所花费的微秒数。自 PHP 7.3.0 和 cURL 7.61.0 起可用 |
CURLINFO_CAINFO
(int)
|
默认内置 CA 证书位置。自 PHP 8.3.0 和 cURL 7.84.0 起可用 |
CURLINFO_CAPATH
(int)
|
默认内置 CA 证书路径。自 PHP 8.3.0 和 cURL 7.84.0 起可用 |
CURLINFO_CERTINFO
(int)
|
TLS 证书链 |
CURLINFO_CONDITION_UNMET
(int)
|
不满足时间条件的信息 |
CURLINFO_CONNECT_TIME
(int)
|
建立连接所花费的秒数 |
CURLINFO_CONNECT_TIME_T
(int)
|
从开始到完成连接远程主机(或代理)所花费的总微秒数。自 PHP 7.3.0 和 cURL 7.61.0 起可用 |
CURLINFO_CONTENT_LENGTH_DOWNLOAD
(int)
|
从 "Content-Length:" 字段读取的下载内容长度 (单位:字节) |
CURLINFO_CONTENT_LENGTH_DOWNLOAD_T
(int)
|
下载的 content-length。该值从 "Content-Length:" 字段读取。如果无法得知大小,则为 -1。自 PHP 7.3.0 和 cURL 7.55.0 起可用 |
CURLINFO_CONTENT_LENGTH_UPLOAD
(int)
|
指定上传大小 |
CURLINFO_CONTENT_LENGTH_UPLOAD_T
(int)
|
指定上传大小。如果大小未知,则为 -1。自 PHP 7.3.0 和 cURL 7.55.0 起可用 |
CURLINFO_CONTENT_TYPE
(int)
|
已请求的文档的 Content-Type 。NULL 表示服务器未发送有效的 Content-Type header。
|
CURLINFO_COOKIELIST
(int)
|
所以已知的 cookie |
CURLINFO_EFFECTIVE_METHOD
(int)
|
获取最后使用的 HTTP 方法。 |
CURLINFO_EFFECTIVE_URL
(int)
|
最后有效的 URL |
CURLINFO_FILETIME
(int)
|
启用 CURLOPT_FILETIME 时,检索文档的远程时间;如果返回 -1,则表示文档的时间未知。
|
CURLINFO_FILETIME_T
(int)
|
检索文档的远程时间 (Unix 时间戳),它是 CURLINFO_FILETIME 的替代方案,允许
32 位长整型的系统提取超出 32 位时间戳范围的日期。自 PHP 7.3.0 和 cURL 7.59.0 起可用
|
CURLINFO_FTP_ENTRY_PATH
(int)
|
FTP 服务器中的条目路径 |
CURLINFO_HEADER_OUT
(int)
|
已发送的请求字符串。如果要生效,需要调用 curl_setopt() 函数将 CURLINFO_HEADER_OUT 选项添加到句柄中
|
CURLINFO_HEADER_SIZE
(int)
|
所有检索到的 header 总大小 |
CURLINFO_HTTPAUTH_AVAIL
(int)
|
之前的响应中,用位掩码表示对应可用的身份验证方法 |
CURLINFO_HTTP_CODE
(int)
|
最后的响应码。自 cURL 7.10.8 起,这是 CURLINFO_RESPONSE_CODE 的遗留别名。
|
CURLINFO_HTTP_CONNECTCODE
(int)
|
CONNECT 响应码 |
CURLINFO_HTTP_VERSION
(int)
|
上次 HTTP 连接中使用的版本。返回值将是定义的 CURL_HTTP_VERSION_*
常量中的一个,或者如果无法确定版本,则返回 0。自 PHP 7.3.0 和 cURL 7.50.0 起可用
|
CURLINFO_LASTONE
(int)
|
libcurl 中底层 CURLINFO 枚举中的最后一个枚举值。
|
CURLINFO_LOCAL_IP
(int)
|
最近连接的本地 (源) IP 地址 |
CURLINFO_LOCAL_PORT
(int)
|
最近连接的本地 (源) 端口 |
CURLINFO_NAMELOOKUP_TIME
(int)
|
域名解析完成所需秒数 |
CURLINFO_NAMELOOKUP_TIME_T
(int)
|
域名解析完成所需的微秒数。自 PHP 7.3.0 和 cURL 7.61.0 起可用 |
CURLINFO_NUM_CONNECTS
(int)
|
为完成上次传输,cURL 创建的连接数 |
CURLINFO_OS_ERRNO
(int)
|
连接失败的错误码 (Errno)。该数字与操作系统和系统相关。 |
CURLINFO_PRETRANSFER_TIME
(int)
|
从开始到文件传输开始之前的秒数 |
CURLINFO_PRETRANSFER_TIME_T
(int)
|
从开始到文件传输即将开始为止所花费的微秒数。自 PHP 7.3.0 和 cURL 7.61.0 起可用 |
CURLINFO_PRIMARY_IP
(int)
|
最近连接的目标 IP 地址 |
CURLINFO_PRIMARY_PORT
(int)
|
最近连接的目标端口 |
CURLINFO_PRIVATE
(int)
|
与 CURL 句柄相关的私有数据,先前使用 curl_setopt() 的
CURLOPT_PRIVATE 选项设置
|
CURLINFO_PROTOCOL
(int)
|
上次 HTTP 连接使用的协议。返回值将是 CURLPROTO_*
值之一。自 PHP 7.3.0 和 cURL 7.52.0 起可用
|
CURLINFO_PROXYAUTH_AVAIL
(int)
|
之前的响应中,用位掩码表示对应可用的代理身份验证方法 |
CURLINFO_PROXY_ERROR
(int)
|
详细的 (SOCKS) 代理错误代码。当最近传输返回 CURLE_PROXY 错误时,该代码会提供更多信息。返回值将是
CURLPX_* 值之一。如果没有可用的响应代码,则错误代码将是
CURLPX_OK 。自 PHP 8.2.0 和 cURL 7.73.0 起可用
|
CURLINFO_PROXY_SSL_VERIFYRESULT
(int)
|
请求(使用 CURLOPT_PROXY_SSL_VERIFYPEER 选项)时,证书的验证结果。仅 HTTPS 代理有效。自 PHP 7.3.0 和 cURL 7.52.0 起可用
|
CURLINFO_REDIRECT_COUNT
(int)
|
启用 CURLOPT_FOLLOWLOCATION 时的重定向次数。
|
CURLINFO_REDIRECT_TIME
(int)
|
启用 CURLOPT_FOLLOWLOCATION 选项后,最终事务开始前所有重定向步骤花费的秒数。
|
CURLINFO_REDIRECT_TIME_T
(int)
|
最终事务开始前所有重定向步骤(包含域名解析、连接、传输前预处理、传输)花费的秒数。自 PHP 7.3.0 和 cURL 7.61.0 起可用 |
CURLINFO_REDIRECT_URL
(int)
|
禁用 CURLOPT_FOLLOWLOCATION 选项:在上一次事务中找到的重定向 URL,接下来应手动请求。启用
CURLOPT_FOLLOWLOCATION 选项:此为空。此情况下的重定向 URL 可在
CURLINFO_EFFECTIVE_URL 中找到。
|
CURLINFO_REFERER
(int)
|
Referer header。自 PHP 8.2.0 和 cURL 7.76.0 起可用
|
CURLINFO_REQUEST_SIZE
(int)
|
发出的请求总大小,目前仅适用于 HTTP 请求 |
CURLINFO_RESPONSE_CODE
(int)
|
最后一个响应代码。自 cURL 7.10.8 起可用 |
CURLINFO_RETRY_AFTER
(int)
|
Retry-After header 中的信息,如果没有有效的 header 则为零。自 PHP 8.2.0 和 cURL 7.66.0 起可用
|
CURLINFO_RTSP_CLIENT_CSEQ
(int)
|
下一个 RTSP 客户端 CSeq |
CURLINFO_RTSP_CSEQ_RECV
(int)
|
最近检索的 CSeq |
CURLINFO_RTSP_SERVER_CSEQ
(int)
|
下一个 RTSP 服务器 CSeq |
CURLINFO_RTSP_SESSION_ID
(int)
|
RTSP session ID |
CURLINFO_SCHEME
(int)
|
用于最近连接的 URL scheme。自 PHP 7.3.0 和 cURL 7.52.0 起可用 |
CURLINFO_SIZE_DOWNLOAD
(int)
|
下载的总字节数 |
CURLINFO_SIZE_DOWNLOAD_T
(int)
|
已下载的总字节数。该数字仅适用于最近一次传输,每次新传输都会重新设置。自 PHP 7.3.0 和 cURL 7.50.0 起可用 |
CURLINFO_SIZE_UPLOAD
(int)
|
上传的总字节数 |
CURLINFO_SIZE_UPLOAD_T
(int)
|
上传的总字节数。自 PHP 7.3.0 和 cURL 7.50.0 起可用 |
CURLINFO_SPEED_DOWNLOAD
(int)
|
平均下载速度 |
CURLINFO_SPEED_DOWNLOAD_T
(int)
|
curl 测量的完整下载的平均下载速度(以字节/秒为单位)。自 PHP 7.3.0 和 cURL 7.50.0 开始可用 |
CURLINFO_SPEED_UPLOAD
(int)
|
平均上传速度 |
CURLINFO_SPEED_UPLOAD_T
(int)
|
curl 测量的完整上传过程的平均上传速度(以字节/秒为单位)。自 PHP 7.3.0 和 cURL 7.50.0 开始可用 |
CURLINFO_SSL_ENGINES
(int)
|
支持 OpenSSL 加密引擎 |
CURLINFO_SSL_VERIFYRESULT
(int)
|
通过设置 CURLOPT_SSL_VERIFYPEER 请求 SSL 认证验证的结果
|
CURLINFO_STARTTRANSFER_TIME
(int)
|
第一个字节即将被传输的时间(以秒为单位) |
CURLINFO_STARTTRANSFER_TIME_T
(int)
|
从开始到接收到第一个字节时所花费的时间(以微秒为单位)。自 PHP 7.3.0 和 cURL 7.61.0 开始可用 |
CURLINFO_TOTAL_TIME
(int)
|
上次传输的总事务时间(秒) |
CURLINFO_TOTAL_TIME_T
(int)
|
上次传输的总时间(以微秒为单位),包括名称解析、TCP 连接等。自 PHP 7.3.0 和 cURL 7.61.0 开始可用 |
CURLINFO_POSTTRANSFER_TIME_T
(int)
|
从开始到发送最后一个字节所花费的微秒数。自 PHP 8.4.0 和 cURL 8.10.0 起可用 |
常量 | 描述 |
---|---|
CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE
(int)
|
指定用于管道处理的块长度阈值(以字节为单位)。自 PHP 7.0.7 和 cURL 7.30.0 起可用 |
CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE
(int)
|
指定用于管道惩罚(pipelining penalty)的长度阈值(以字节为单位)。自 PHP 7.0.7 和 cURL 7.30.0 起可用 |
CURLMOPT_MAXCONNECTS
(int)
|
指定 libcurl 可以缓存的最大同时打开的连接数。默认情况下,这个大小会自动扩展到通过 curl_multi_add_handle() 添加的句柄数的四倍。当缓存已满时,cURL 会关闭缓存中最旧的一个连接,以防止打开的连接数继续增加。自 cURL 7.16.3 起可用 |
CURLMOPT_MAX_CONCURRENT_STREAMS
(int)
|
指定 cURL 在使用 HTTP/2 连接中应支持的最大并发流数量。有效值范围是从 1 到
2147483647 (2^31 - 1 )。这里设置的值将根据其他系统资源属性来确定是否执行。默认值是
100 。自 PHP 8.2.0 和 cURL 7.67.0 起可用。
|
CURLMOPT_MAX_HOST_CONNECTIONS
(int)
|
指定单个主机的最大连接数。自 PHP 7.0.7 和 cURL 7.30.0 起可用 |
CURLMOPT_MAX_PIPELINE_LENGTH
(int)
|
指定管道中的最大请求数。自 PHP 7.0.7 和 cURL 7.30.0 起可用 |
CURLMOPT_MAX_TOTAL_CONNECTIONS
(int)
|
指定同时打开的最大连接数。自 PHP 7.0.7 和 cURL 7.30.0 起可用 |
CURLMOPT_PIPELINING
(int)
|
传递 1 启用或传递 0 禁用。在多句柄上启用管道将使其尝试对使用此句柄的传输尽可能执行 HTTP 管道操作。这意味着如果添加的第二个请求可以使用已有连接,则第二个请求将在同一连接上使用“管道”。自 cURL 7.43.0 起,该值是位掩码,传递 2 将尝试在现有的 HTTP/2 连接上多路复用新传输。传递 3 指示 cURL 请求彼此独立的管道和多路复用。自 cURL 7.62.0 起,设置管道 bit 没有效果。除了整数文字,还可以使用 CURLPIPE_* 常量。自 cURL 7.16.0 起可用。 |
CURLMOPT_PUSHFUNCTION
(int)
|
传递 callable 以注册处理服务器推送且应具有以下签名:
CURL_PUSH_OK ,或者返回
CURL_PUSH_DENY 拒绝。自 PHP 7.1.0 和 cURL 7.44.0 起可用。
|
常量 | 描述 |
---|---|
CURLPROTO_ALL
(int)
|
自 cURL 7.19.4 起可用。 |
CURLPROTO_DICT
(int)
|
自 cURL 7.19.4 起可用。 |
CURLPROTO_FILE
(int)
|
自 cURL 7.19.4 起可用。 |
CURLPROTO_FTP
(int)
|
自 cURL 7.19.4 起可用。 |
CURLPROTO_FTPS
(int)
|
自 cURL 7.19.4 起可用。 |
CURLPROTO_GOPHER
(int)
|
自 cURL 7.21.2 起可用。 |
CURLPROTO_HTTP
(int)
|
自 cURL 7.19.4 起可用。 |
CURLPROTO_HTTPS
(int)
|
自 cURL 7.19.4 起可用。 |
CURLPROTO_IMAP
(int)
|
自 cURL 7.20.0 起可用。 |
CURLPROTO_IMAPS
(int)
|
自 cURL 7.20.0 起可用。 |
CURLPROTO_LDAP
(int)
|
自 cURL 7.19.4 起可用。 |
CURLPROTO_LDAPS
(int)
|
自 cURL 7.19.4 起可用。 |
CURLPROTO_MQTT
(int)
|
自 PHP 8.2.0 和 cURL 7.71.0 起可用。 |
CURLPROTO_POP3
(int)
|
自 cURL 7.20.0 起可用。 |
CURLPROTO_POP3S
(int)
|
自 cURL 7.20.0 起可用。 |
CURLPROTO_RTMP
(int)
|
自 cURL 7.21.0 起可用。 |
CURLPROTO_RTMPE
(int)
|
自 cURL 7.21.0 起可用。 |
CURLPROTO_RTMPS
(int)
|
自 cURL 7.21.0 起可用。 |
CURLPROTO_RTMPT
(int)
|
自 cURL 7.21.0 起可用。 |
CURLPROTO_RTMPTE
(int)
|
自 cURL 7.21.0 起可用。 |
CURLPROTO_RTMPTS
(int)
|
自 cURL 7.21.0 起可用。 |
CURLPROTO_RTSP
(int)
|
自 cURL 7.20.0 起可用。 |
CURLPROTO_SCP
(int)
|
自 cURL 7.19.4 起可用。 |
CURLPROTO_SFTP
(int)
|
自 cURL 7.19.4 起可用。 |
CURLPROTO_SMB
(int)
|
自 PHP 7.0.7 和 cURL 7.40.0 起可用。 |
CURLPROTO_SMBS
(int)
|
自 PHP 7.0.7 和 cURL 7.40.0 起可用。 |
CURLPROTO_SMTP
(int)
|
自 cURL 7.20.0 起可用。 |
CURLPROTO_SMTPS
(int)
|
自 cURL 7.20.0 起可用。 |
CURLPROTO_TELNET
(int)
|
自 cURL 7.19.4 起可用。 |
CURLPROTO_TFTP
(int)
|
自 cURL 7.19.4 起可用。 |
常量 | 描述 |
---|---|
CURLM_ADDED_ALREADY
(int)
|
重复添加句柄到多句柄。自 cURL 7.32.1 起可用。 |
CURLM_BAD_EASY_HANDLE
(int)
|
句柄无效或者不正确。这可能意味着这不是句柄或者该句柄已经被自身或者其他多句柄使用了。自 cURL 7.9.6 起可用。 |
CURLM_BAD_HANDLE
(int)
|
传入的句柄不是有效的多句柄。自 cURL 7.9.6 起可用。 |
CURLM_CALL_MULTI_PERFORM
(int)
|
从 cURL 7.20.0 起,不再使用此常量。在 cURL 7.20.0 之前,如果在返回任何其他常量之前调用 curl_multi_select() 或类似函数时,curl_multi_exec() 可能会返回此状态。自 cURL 7.9.6 起可用。 |
CURLM_INTERNAL_ERROR
(int)
|
内部 libcurl 错误。自 cURL 7.9.6 起可用。
|
CURLM_OK
(int)
|
没有错误。自 cURL 7.9.6 起可用。 |
CURLM_OUT_OF_MEMORY
(int)
|
处理多句柄时内存不足。自 cURL 7.9.6 起可用。 |
常量 | 描述 |
---|---|
CURLPAUSE_ALL
(int)
|
暂停发送和接收数据。自 cURL 7.18.0 起可用。 |
CURLPAUSE_CONT
(int)
|
取消暂停发送和接收数据。自 cURL 7.18.0 起可用。 |
CURLPAUSE_RECV
(int)
|
暂停接收数据。自 cURL 7.18.0 起可用。 |
CURLPAUSE_RECV_CONT
(int)
|
取消暂停接收数据。自 cURL 7.18.0 起可用。 |
CURLPAUSE_SEND
(int)
|
暂停发送数据。自 cURL 7.18.0 起可用。 |
CURLPAUSE_SEND_CONT
(int)
|
取消暂停发送数据。自 cURL 7.18.0 起可用。 |
用户贡献的备注 5 notes
I hope this would be useful to convert error codes:
<?php
$curl_errno = array(
1 => "CURLE_UNSUPPORTED_PROTOCOL",
2 => "CURLE_FAILED_INIT",
3 => "CURLE_URL_MALFORMAT",
4 => "CURLE_URL_MALFORMAT_USER",
5 => "CURLE_COULDNT_RESOLVE_PROXY",
6 => "CURLE_COULDNT_RESOLVE_HOST",
7 => "CURLE_COULDNT_CONNECT",
8 => "CURLE_FTP_WEIRD_SERVER_REPLY",
9 => "CURLE_FTP_ACCESS_DENIED",
10 => "CURLE_FTP_USER_PASSWORD_INCORRECT",
11 => "CURLE_FTP_WEIRD_PASS_REPLY",
12 => "CURLE_FTP_WEIRD_USER_REPLY",
13 => "CURLE_FTP_WEIRD_PASV_REPLY",
14 => "CURLE_FTP_WEIRD_227_FORMAT",
15 => "CURLE_FTP_CANT_GET_HOST",
16 => "CURLE_FTP_CANT_RECONNECT",
17 => "CURLE_FTP_COULDNT_SET_BINARY",
18 => "CURLE_FTP_PARTIAL_FILE or CURLE_PARTIAL_FILE",
19 => "CURLE_FTP_COULDNT_RETR_FILE",
20 => "CURLE_FTP_WRITE_ERROR",
21 => "CURLE_FTP_QUOTE_ERROR",
22 => "CURLE_HTTP_NOT_FOUND or CURLE_HTTP_RETURNED_ERROR",
23 => "CURLE_WRITE_ERROR",
24 => "CURLE_MALFORMAT_USER",
25 => "CURLE_FTP_COULDNT_STOR_FILE",
26 => "CURLE_READ_ERROR",
27 => "CURLE_OUT_OF_MEMORY",
28 => "CURLE_OPERATION_TIMEDOUT or CURLE_OPERATION_TIMEOUTED",
29 => "CURLE_FTP_COULDNT_SET_ASCII",
30 => "CURLE_FTP_PORT_FAILED",
31 => "CURLE_FTP_COULDNT_USE_REST",
32 => "CURLE_FTP_COULDNT_GET_SIZE",
33 => "CURLE_HTTP_RANGE_ERROR",
34 => "CURLE_HTTP_POST_ERROR",
35 => "CURLE_SSL_CONNECT_ERROR",
36 => "CURLE_BAD_DOWNLOAD_RESUME or CURLE_FTP_BAD_DOWNLOAD_RESUME",
37 => "CURLE_FILE_COULDNT_READ_FILE",
38 => "CURLE_LDAP_CANNOT_BIND",
39 => "CURLE_LDAP_SEARCH_FAILED",
40 => "CURLE_LIBRARY_NOT_FOUND",
41 => "CURLE_FUNCTION_NOT_FOUND",
42 => "CURLE_ABORTED_BY_CALLBACK",
43 => "CURLE_BAD_FUNCTION_ARGUMENT",
44 => "CURLE_BAD_CALLING_ORDER",
45 => "CURLE_HTTP_PORT_FAILED",
46 => "CURLE_BAD_PASSWORD_ENTERED",
47 => "CURLE_TOO_MANY_REDIRECTS",
48 => "CURLE_UNKNOWN_TELNET_OPTION",
49 => "CURLE_TELNET_OPTION_SYNTAX",
50 => "CURLE_OBSOLETE",
51 => "CURLE_SSL_PEER_CERTIFICATE",
52 => "CURLE_GOT_NOTHING",
53 => "CURLE_SSL_ENGINE_NOTFOUND",
54 => "CURLE_SSL_ENGINE_SETFAILED",
55 => "CURLE_SEND_ERROR",
56 => "CURLE_RECV_ERROR",
57 => "CURLE_SHARE_IN_USE",
58 => "CURLE_SSL_CERTPROBLEM",
59 => "CURLE_SSL_CIPHER",
60 => "CURLE_SSL_CACERT",
61 => "CURLE_BAD_CONTENT_ENCODING",
62 => "CURLE_LDAP_INVALID_URL",
63 => "CURLE_FILESIZE_EXCEEDED",
64 => "CURLE_FTP_SSL_FAILED",
79 => "CURLE_SSH"
);
?>
Beware of CURLE_* constants!
On the official site:
http://curl.haxx.se/libcurl/c/libcurl-errors.html
some constants are different, some missing compared to the PHP implementation.
Some examples:
in PHP the curl error number 28 is called
CURLE_OPERATION_TIMEOUTED
while in the official site is:
CURLE_OPERATION_TIMEDOUT
So if you use the second, it won't march the error 28 because in PHP it is not defined that way.
The same is for these:
CURLE_HTTP_RETURNED_ERROR
CURLE_UPLOAD_FAILED
CURLE_INTERFACE_FAILED
CURLE_SSL_CERTPROBLEM
CURLE_SEND_FAIL_REWIND
CURLE_LOGIN_DENIED
CURLE_AGAIN
that are in someway named differently or missing from PHP.
Regarding CURLE_OPERATION_TIMEDOUT vs. CURLE_OPERATION_TIMEOUTED:
Originally cURL had the constant named TIMEOUTED (read: "timeout-ed"). This was changed[1] in 2007 and v7.17.0 to be TIMEDOUT (read: "timed out") and the old constant kept in place as an alias.
PHP started off using TIMEOUTED as well. The TIMEDOUT constant was added[2] in 2012 and v5.5.0 and the old constant was *kept in place*.
If you ask me, the TIMEDOUT constant reads more nicely (not to mention is technically the correct one to use) and as long as you're using PHP 5.5+ then it is available. If you have to support older versions then I suggest you keep using the new constant and add a polyfill like
<?php
if (version_compare(PHP_VERSION, "5.5.0", "<")) {
define("CURLE_OPERATION_TIMEDOUT", CURLE_OPERATION_TIMEOUTED);
}
?>
or
<?php
// PHP <5.5.0
defined("CURLE_OPERATION_TIMEDOUT") || define("CURLE_OPERATION_TIMEDOUT", CURLE_OPERATION_TIMEOUTED);
?>
to be removed once you stop supporting them.
[1] https://github.com/bagder/curl/commit/9f44a95522162c0f4a61093efe1bf1f58b087358#diff-d8c6cb80505e0f7d5e27fca2a682aa34L119
[2] https://github.com/php/php-src/commit/9ab45d3edbafa3ee751472c3f8d1fb3f51f38cf1#diff-ac978e3de205f1d14eb960e0eb15ef24R723
<?
/*
* Author: Ron
* Released: August 4, 2007
* Description: An example of the disguise_curl() function in order to grab contents from a website while remaining fully camouflaged by using a fake user agent and fake headers.
*/
$url = 'http://www.ericgiguere.com/tools/http-header-viewer.html';
// disguises the curl using fake headers and a fake user agent.
function disguise_curl($url)
{
$curl = curl_init();
// Setup headers - I used the same headers from Firefox version 2.0.0.6
// below was split up because php.net said the line was too long. :/
$header[0] = "Accept: text/xml,application/xml,application/xhtml+xml,";
$header[0] .= "text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";
$header[] = "Cache-Control: max-age=0";
$header[] = "Connection: keep-alive";
$header[] = "Keep-Alive: 300";
$header[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7";
$header[] = "Accept-Language: en-us,en;q=0.5";
$header[] = "Pragma: "; // browsers keep this blank.
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_USERAGENT, 'Googlebot/2.1 (+http://www.google.com/bot.html)');
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
curl_setopt($curl, CURLOPT_REFERER, 'http://www.google.com');
curl_setopt($curl, CURLOPT_ENCODING, 'gzip,deflate');
curl_setopt($curl, CURLOPT_AUTOREFERER, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_TIMEOUT, 10);
$html = curl_exec($curl); // execute the curl command
curl_close($curl); // close the connection
return $html; // and finally, return $html
}
// uses the function and displays the text off the website
$text = disguise_curl($url);
echo $text;
?>
~Ron