이전 목록 다음
채택완료

php curl이 갑자기 안될수도있나요?

os 는 윈도우, php 5.6 입니다.

같은 소스로 저번주까지 잘 사용했습니다. (같은 소스로 맥 local에서 이상없음)

Copy
function curl($url, $isPost = FALSE, $jsonData) {
 $ch = curl_init();
 
 curl_setopt($ch, CURLOPT_URL, $url);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
 curl_setopt($ch,CURLOPT_HTTPHEADER, array(
  'Content-Type: application/json'
 ));
 if ($isPost) {
  $post_data = json_encode($jsonData);
  
  //POST방식
  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
  curl_setopt($ch, CURLOPT_POST, true);
  //POST방식으로 넘길 데이터(JSON데이터)
  curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
  curl_setopt($ch, CURLOPT_TIMEOUT, 3);
  
 }
 
 $g = curl_exec($ch);
 curl_close($ch);
 return $g;
}

php error log를 보니 
PHP Fatal error:  Call to undefined function curl_init() in 파일위치

라고 나오고있어서 php.ini 파일에 extension=php_curl.dll 를 확인해 봤지만 별 특이사항없고, 실제파일도 정상적으로 있습니다.. (php.ini 파일을 수정한것은 3달 이전입니다)

https://stackoverflow.com/questions/6382539/call-to-undefined-function-curl-init

윈도우에서 PHP Fatal error:  Call to undefined function curl_init() in 오류 시 더 봐야할 부분좀 알려주세요 ㅠㅠ 저번주에 되던게 안되니 답답하네요

|

답변 1개 / 댓글 1개

채택된 답변
+20 포인트

Phpinfo 함수로 확인해 보셨을까요?

제대로 반영이 안된걸수도 있으니

해당 curl dll이 주석처리 안되어 있는지 체크해 보세요

답변에 대한 댓글 1개

Phpinfo 에서 curl이 안보였네요 ㅠ
php_curl.dll 파일을 바꾸니 잘 됩니다 감사합니다.

답변을 작성하려면 로그인이 필요합니다.