I am trying to call a site on localhost from another also on localhost using CURL in PHP. (It's a test)
I'm using windows 7
Both are set up in the host file and work fine if accessed directly
I get a 404 error. If I call a site on the web then it comes back fine.
Is this not possible?
protected function get($url)
{
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
$response = curl_exec($curl);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if($httpCode != 200)
throw new CHttpException($httpCode, 'Curl Error : ' . $response);
return $response;
}