Ben sadece bir çizgi echos basit bir "sunucu" komut dosyası var:
<?php
echo "Server script on http://".$_SERVER['SERVER_NAME']." saying hello!";
Ve sunucu komut dosyası kıvrık bir "müşteri" komut:
<?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 = curl_exec($ch);
curl_close($ch);
echo "<br/>Data returned from server script:";
echo "<hr/>";
echo $data;
- Works fine: http://localhost/client.php curling http://localhost/server.php
- Works fine: http://localhost/client.php curling http://remotehost/server.php
- Doesn't work: http://remoteserver/client.php curling itself http://remotehost/server.php
Son alternatif uzak sunucudan yanıt, zaman aşımı kadar sadece tarayıcı çiğneme neden olur. Herhangi bir fikir?