I have a PHP script that uses cURL to access a file that is also located on my server (installed email program). I wrote a quick script to check my cURL installation, and it does not work when it points to a file on my own server. script:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.mysite.com/test.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$contents = curl_exec($ch);
if($contents) {
echo $contents;
} else {
$err = curl_error($ch);
echo $err;
}
curl_close($ch);
When I run this code, it returns an error: could not connect to the host
URL- http://www.google.com , . , cURL , , . , , , PHP cURL (kinda) , .
, , ( ). curl_setopt, http://www.mysite.com:80/ , , , .
, - - apache, apache, Google, . , cURL-?