我很难弄清楚为什么我的php Curl API在使用MAMP的Mac上工作得很好,但在windows下却不能工作。
我询问了有关在windows下查找卷曲配置问题的调试技巧或有用信息。
接受的答案包含了帮助我在windows 7 32位上工作的步骤列表。
发布于 2015-07-10 20:08:55
以下是调试Curl的步骤列表:
在phpinfo模块中签入Curl已启用。
验证扩展dir路径是在php.ini中设置的,并且extension=php_curl.dll没有注释。
检查环境变量是否按以下方式设置:http://php.net/manual/en/faq.installation.php#faq.installation.addtopath
运行deplister.exe ext\php_curl.dll以验证所有依赖项是否正确满足。
如果以上所有内容都正常工作,那么检查CURLOPT_VERBOSE的输出。如下所示@ in 95建议:No Response getting from Curl Request to https server
如果您正在访问使用SSL的站点,请检查以下帖子:CERTIFICATE:certificate verify failed, CA is OK
然后像这样把它修好:
发布于 2015-07-10 18:33:22
如果Curl仍然不能工作,您可以使用file_get_contents发出POST请求。它工作在所有主机,所有操作系统和本地。
$url = 'WhateverUrlYouWant';
$postdata = http_build_query(
array(
'id' => '202',
'form' => 'animal',
.....
)
);
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $postdata
)
);
$context = stream_context_create($opts);
$result = file_get_contents($url,false, $context);
echo $result发布于 2015-07-10 17:02:50
反转
至
https://stackoverflow.com/questions/31346149
复制相似问题