The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > IP Networking
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 04-10-2008
Sergiu-IT's Avatar
Sergiu-IT Sergiu-IT is offline
Registered User
  
 

Join Date: Mar 2005
Location: Transilvania
Posts: 133
Quote:
Originally Posted by sysgate View Post
Is this in the apache log ? This is usually an PHP error message. Still, you haven't shown your scripts, what DNS functions are implemented ? gethostbyaddr, gethostbyname , ENV{HOSTNAME} ?
Yes, I get that in apache error_log file, but I realised that it is not connected to this error. I have a small script that I just made:

Code:
<?php
$host= "www.unix.com";
$sc  = fsockopen($host,80) or die("Error creating socket");
$out = "GET / HTTP/1.1\r\n";
$out.= "Host: $hostrn";
$out.= "Connection: Close\r\n\r\n";
fwrite($sc, $out);
fclose($sc);
?>
The error that I get in the browser is this:
Code:
Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: hostname nor servname provided, or not known in /home/test/public_html/test.php on line 3

Warning: fsockopen() [function.fsockopen]: unable to connect to www.unix.com:80 (Unknown error) in /home/test/public_html/test.php on line 3
Error creating socket
On another server it works perfectly - the diference is that the apache version is 1.3, not 2.0.