Curl from wamp windows7 64bit unanswered external website

0

Good afternoon, I'm trying to make a call to a website using curl, from php, from windows 7 64bit, using wamp v2.2 and php v5.4.3. This returns a null. If in the same code I change the URL for a local, the curl works. Download a fix for the curl but the result is the same, in phpinfo the curl is working (in fact it works for a local url). Two days ago I'm trying to solve it, I do not know where to go, thank you very much.

<?PHP
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://webservice...");

$response=curl_exec($ch);
if (!curl_errno($ch)) {
  switch ($http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE)) {
    case 200:  # OK
      break;
    default:
      echo 'Código HTTP inesperado: ', $http_code, "\n";
  }
}else{
	$response=json_decode($response);
	var_dump($response);
}
curl_close($ch);/*

?>
    
asked by Nicolás 04.06.2017 в 21:02
source

1 answer

0

Thanks to Juan for answering, I was able to solve it thanks to your questions, I'm doing this from a localhost as a test, then I'll need an ssl but that's another story, just add the following to the code after curl_init (); (I do not know if it's the best but it's what I found out)

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    
answered by 04.06.2017 / 21:51
source