curl https ERR_EMPTY_RESPONSE 페이지가 작동하지 않습니다. 채택완료
curl https ERR_EMPTY_RESPONSE 페이지가 작동하지 않습니다.
센토스 에서 아래와 같이 명령을 내리면
curl https://naver.com
-------------------------
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center> NWS </center>
</body>
</html>
-------------------------
이렇게 출력이 됩니다.
php 에서 curl 로 아래와 같이 실행하면..
</strong></p>
<p>$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,"<a href="https://naver.com");" target="_blank" rel="noopener noreferrer">https://naver.com");</a>
curl_setopt($ch,CURLOPT_PORT,"443");
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output=curl_exec($ch);
if ($output === FALSE) {
$curl_error = "cURL Error: " . curl_error($ch);
}
curl_close($ch);
echo $output;</p>
<p><strong>
------------------------------------
페이지가 작동하지 않습니다.
xxx.xxx.xxx.xxx에서 전송한 데이터가 없습니다.
ERR_EMPTY_RESPONSE
------------------------------------
xxx.xxx.xxx.xxx 는 실행되는 서버 아이피입니다.
php 의 curl 의 url 을 http 로 설정시에는 잘 작동 됩니다.
하지만 https 로의 접속만은 페이지가 작동하지 않습니다
ERR_EMPTY_RESPONSE 로 나옵니다.
왜 그런지 아시는분 답글 달아 주시면 감사하겠습니다. ㅠㅠ
답변 3개
답변에 대한 댓글 2개
위 함수 그대로 사용해보세요.
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
을 넣어도 보고
curl_setopt($ch, CURLOPT_CAINFO, $_SERVER['DOCUMENT_ROOT']."/function_api/cacert.pem");
폴더에 인증서 번들을 넣어 보아도 같은 오류로 나오네요 ㅠㅠ