title: error connecting client server [Host lookup failed [0]:]
body: <p>I tried to connect client server but end with the following error on the client side.</p>
  
  <blockquote>
    <p>Host lookup failed [0]:</p>
  </blockquote>
  
  <p>What could be the possible solution?</p>
  
  <pre><code>&lt;?php
  $host    = "192.168.1.7";
  $port    = 2300;
  $message = "Hello Server";
  echo "Message To server :".$message;
  // create socket
  $socket = socket_create(AF_INET, SOCK_STREAM, 0) or die("Could not create socket\n");
  // connect to server
  $result = socket_connect($socket, $host, $port) or die("Could not connect to     server\n");  
  // send string to server
  socket_write($socket, $message, strlen($message)) or die("Could not send data to    server\n");
  // get server response
  $result = socket_read ($socket, 1024) or die("Could not read server response\n");
  echo "Reply From Server  :".$result;
  // close socket
  socket_close($socket);
  ?&gt;
  </code></pre>
  
  <p>I wanna connect a simple php client to a php server .. The server and the client are in two different systems in the same network though .. I use Apache thru xampp..</p>
  
  <p>THIS WAS THE ACTUAL ERROR</p>
  
  <blockquote>
    <p>Warning: socket_connect() [function.socket-connect]: Host lookup failed [0]: The requested name is valid, but no data of the requested type was found. in D:\Program Files\XAMPP\htdocs\php\client.php on line 9
    Could not connect to server</p>
  </blockquote>