PHP curl在现场提供404错误但在本地工作正常

时间:2016-06-27 09:54:28

标签: php curl

您好我正在使用php curl请求。它在本地工作正常,但在现场网站上找不到http_code 404给出404页面错误。这是我正在使用的代码:

 $ch = curl_init();
 curl_setopt($ch, CURLOPT_URL, $url);
 curl_setopt($ch, CURLOPT_POST, 1);
 curl_setopt($ch, CURLOPT_POSTFIELDS, "strJSON=" . json_encode($api_array));
 curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 $server_output = curl_exec($ch);

完全相同的代码在本地提供完美输出但给出404页面。无法弄清楚问题。

0 个答案:

没有答案
相关问题