PHP 与卷曲和视窗Vista
在 Windows Vista 上使用 cURL 时遇到问题。该库在那里并用 phpinfo() 显示,但curl_exec() 没有返回网页内容 - 当在 Linux 服务器上上传和测试时,相同的代码没有问题,按预期返回数据。
有人有这方面的经验/想法吗?我正在使用 xampp 和 php 5.2.6。
更新:
Array( [url] => https://graph.facebook.com/me
[content_type] => [http_code] => 0
[header_size] => 0
[request_size] => 0
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0
[namelookup_time] => 0
[connect_time] => 0.203
[pretransfer_time] => 0
[size_upload] => 0
[size_download] => 0
[speed_download] => 0
[speed_upload] => 0
[download_content_length] => -1
[upload_content_length] => -1
[starttransfer_time] => 0
[redirect_time] => 0 )
是我从 print_r(curl_getinfo($ch)); 得到的响应
Having issues using cURL on windows vista. The library is there and showing with phpinfo(), but curl_exec() is not returning the web page content - when uploaded and tested on a linux server there's no problems with the same code, returns the data as expected.
Does anyone have any experience with this/ideas? I'm using xampp and php 5.2.6.
UPDATE:
Array( [url] => https://graph.facebook.com/me
[content_type] => [http_code] => 0
[header_size] => 0
[request_size] => 0
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0
[namelookup_time] => 0
[connect_time] => 0.203
[pretransfer_time] => 0
[size_upload] => 0
[size_download] => 0
[speed_download] => 0
[speed_upload] => 0
[download_content_length] => -1
[upload_content_length] => -1
[starttransfer_time] => 0
[redirect_time] => 0 )
Is the response I get from print_r(curl_getinfo($ch));
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我注意到这是一个
https
地址。尝试这样做:
将其设置为 false 允许
Curl
接受任何CA
。您可以在此处查看文档:
http://php.net/manual/en/function.curl-setopt.php
I noticed that's a
https
address.Try doing this:
Setting that to false allows
Curl
to accept anyCA
.You can check the documentation here:
http://php.net/manual/en/function.curl-setopt.php
我认为你应该改变:
[url] => https://graph.facebook.com/me
我假设您使用的是逗号分隔 php 数组中的键值对。
I think you should change:
[url] => https://graph.facebook.com/me
toI assume that you are using commas to separate the key-value pairs in php array.