根据php manual,我应该可以使用CURLOPT_PROXYHEADER常量:
CURLOPT_PROXYHEADER(整数)
自PHP 7.0.7和cURL7.37.0
以来可用
但是我收到了这个错误:
注意:使用未定义的常量CURLOPT_PROXYHEADER - 假设为'CURLOPT_PROXYHEADER'
我的php版本是:
php -v
PHP 7.1.0RC6(cli)(NTS)
我已经安装了php7.1-curl。
我的卷曲版本是:
curl --version
curl 7.51.0(x86_64-pc-linux-gnu)libcurl / 7.51.0 OpenSSL / 1.0.1f zlib / 1.2.8
为什么我不能使用常量?
编辑:添加了phpinfo的卷曲部分:
curl
cURL support => enabled
cURL Information => 7.51.0
Age => 3
Features
AsynchDNS => No
CharConv => No
Debug => No
GSS-Negotiate => No
IDN => No
IPv6 => Yes
krb4 => No
Largefile => Yes
libz => Yes
NTLM => Yes
NTLMWB => Yes
SPNEGO => No
SSL => Yes
SSPI => No
TLS-SRP => Yes
HTTP2 => No
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, pop3, pop3s, rtsp, smb, smbs, smtp, smtps, telnet, tftp
Host => x86_64-pc-linux-gnu
SSL Version => OpenSSL/1.0.1f
ZLib Version => 1.2.8