좋아, SSL 사이트에 cURL을 사용하여 HTTP_POST를 만들고 싶습니다. 이미 서버에 인증서를 가져 왔습니다. 그것은 "500"반환 계속cURL + HTTP_POST, 계속 500 오류가 발생합니다. 모르겠어?
$url = "https://www.xxx.xxx";
$post = "";# all data that going to send
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0');
$exe = curl_exec($ch);
$getInfo = curl_getinfo($ch);
if ($exe === false) {
$output = "Error in sending";
if (curl_error($ch)){
$output .= "\n". curl_error($ch);
}
} else if($getInfo['http_code'] != 777){
$output = "No data returned. Error: " . $getInfo['http_code'];
if (curl_error($ch)){
$output .= "\n". curl_error($ch);
}
}
curl_close($ch);
echo $output;
: 이것은 내 코드입니다. w3schools를 기준으로 500은 내부 서버 오류를 의미합니다. 내 서버에 문제가 있습니까? 이 문제를 어떻게 해결할 것인가?
내 호스팅 회사에 문의해야합니까? – mysqllearner
서버의 로그에 직접 액세스 할 수없는 경우 예를 들어 보낼 수 있습니다. – Kaltezar