php/curl: Timeout problem when remote server curling itself

abshchinder

New Member
I have a simple "server" script that just echos a line:\[code\]<?php echo "Server script on http://".$_SERVER['SERVER_NAME']." saying hello!";\[/code\]And a "client" script curling the server script:\[code\]<?php echo "Client script";$url = "http://localhost/server.php";$ch = curl_init();curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = http://stackoverflow.com/questions/2081344/curl_exec($ch);curl_close($ch); echo"<br/>Data returned from server script:";echo "<hr/>";echo $data;\[/code\]The last alternative causes no response from the remote server, just the browser chewing until timeout. Any ideas?
 
Back
Top