如何在 PHP (cURL) 中启用 IDN 支持?
我的 cURL 配置(来自 phpinfo()
函数)是:
cURL support enabled
cURL Information 7.21.7
Age 3
Features
AsynchDNS Yes
Debug No
GSS-Negotiate Yes
IDN No
IPv6 Yes
Largefile Yes
NTLM Yes
SPNEGO No
SSL Yes
SSPI Yes
krb4 No
libz Yes
CharConv No
Protocols dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp
Host i386-pc-win32
SSL Version OpenSSL/0.9.8r
ZLib Version 1.2.5
libSSH Version libssh2/1.2.7
IDN 的值为 No。我可以启用它吗?如何?
谢谢!
My cURL configuration (fro phpinfo()
function) is:
cURL support enabled
cURL Information 7.21.7
Age 3
Features
AsynchDNS Yes
Debug No
GSS-Negotiate Yes
IDN No
IPv6 Yes
Largefile Yes
NTLM Yes
SPNEGO No
SSL Yes
SSPI Yes
krb4 No
libz Yes
CharConv No
Protocols dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp
Host i386-pc-win32
SSL Version OpenSSL/0.9.8r
ZLib Version 1.2.5
libSSH Version libssh2/1.2.7
IDN has as value No. Can I enable it? How?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您必须下载 libcURL 7.21.7(或其他一些二进制兼容版本)并使用 IDN 支持重新编译它。您需要在系统中安装libidn(包括您要构建的计算机中的开发文件) libcURL)。
或者,您也可以下载最新版本的 libcURL,但在这种情况下您可能必须重新编译 PHP(或至少是 cURL 扩展)。
请注意,您还可以使用
idn_to_ascii
预处理 URL。You will have to download libcURL 7.21.7 (or some other binary compatible version) and recompile it with IDN support. You will need libidn installed in your system (including development files in the machine where you'll build libcURL).
Alternatively, you can also download the most recent version of libcURL, but you will likely have to recompile PHP (or at least the cURL extension) in that case.
Note that you can also preprocess your URLs using
idn_to_ascii
.我用库解决了我的问题 http://phlymail.com/en/downloads/idna/
I solve my problem with the library http://phlymail.com/en/downloads/idna/