[PHP] getaddrinfo failed in fsockopen()
Hi, I am having problems while executing this simple php script: ? $fp = fsockopen (www.example.com, 80, $errno, $errstr, 30); if (!$fp) { echo $errstr ($errno)br\n; } else { fputs ($fp, GET / HTTP/1.0\r\nHost: www.example.com\r\n\r\n); while (!feof($fp)) { echo fgets ($fp,128); } fclose ($fp); } ? The error message is: --- Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name does not resolv to supplied parameters; neither nodename nor servname were passed. in /imports/home/gbien/ait/manrod/public_html/prueba_fsockopen.php on line 2 Warning: fsockopen(): unable to connect to www.example.com:80 in /imports/home/gbien/ait/manrod/public_html/prueba_fsockopen.php on line 2 Not owner (1)br -- but DNS on the server is running. PHP version is 4.3.4, running on dec alpha with True64 Unix V5.1 and configure options: /configure' '--prefix=/usr/local/packages/php-4.3.4' '--exec-prefix=/usr/local/packages/php-4.3.4/alpha-dec-osf5.1' '--with-config-file-path' '--with-apxs=/usr/local/packages/apache_1.3.29/alpha-dec-osf5.1/bin/apxs' '--enable-force-cgi-redirect' '--enable-track-vars' '--with-gettext' '--with-openssl' '--with-zlib' '--with-bz2' '--with-jpeg-dir' '--with-tiff-dir' '--with-png-dir' '--with-xpm-dir' '--with-pgsql' '--with-mm' The same script executed in a Sparc server with Solaris 2.7, and the same php version and configuration (but without postgresql support) gives no errors... Any help would be greatly appreciated. Thanks. Manuel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] getaddrinfo failed: No address associated with hostname
tor, 2002-11-28 kl. 05:22 skrev Godzilla: Warning: php_network_getaddresses: getaddrinfo failed: No address associated with hostname Your DNS doesn't work any more? Best, Tony -- Tony Earnshaw When all's said and done ... there's nothing left to say or do. e-post: [EMAIL PROTECTED] www:http://www.billy.demon.nl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] getaddrinfo failed: No address associated with hostname
I have a php script setup which downloads a file from a remote server via FTP. It worked fine for a couple months until I went to use it one day and it returned the error below. I hadn't made any changes to the script in that time. It was no big deal so I wrote it off as it wasn't really an important script. Today I went to use the fopen command in another php script with a remote http file and it returned the same error. I'm not sure if this is a php config thing or something else. Warning: php_network_getaddresses: getaddrinfo failed: No address associated with hostname Any help would be greatly appreciated. Thanks! -Tim Here is a snippet of the ftp script: - $ftp_server=domain.com; $ftp_user_name=user; $ftp_user_pass=password $localfile=/home/usernam/www/filename.txt; $remotefile=/paht/to/remotfile/filename.txt; $hostname_softcart = mysqlhostname; $database_softcart = dbasename; $username_softcart = user; $password_softcart = password $dbase_name = dbase; $file=$PHP_SELF; // Connect to FTP server $conn_id = ftp_connect($ftp_server); // Login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // Check Connection if ((!$conn_id) || (!$login_result)) { echo FTP connection has failed!; echo Attempted to connect to $ftp_server for user $ftp_user_name; die; } else { echo Step 1: Connected to $ftp_server Succesfully.br; } // Set Passive Transfer Mode. ftp_pasv($conn_id, pasv); // Display Download Button echo form action=$file; echo input type=hidden name=download value=true; echo Step 2: input type=submit value=\Click Here to download Database file\br; echo /form; // Download the file if (isset($download)) { $download = ftp_get($conn_id, $localfile, $remotefile, FTP_ASCII); // Check download success...if its OK do some stuff if (!$download) { echo FTP Download has failed!; } else { echo STUFF ; } } // close the FTP stream ftp_close($conn_id); - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] getaddrinfo failed
So what's on /usr/home/pagon/www/index.php on line 497 at a few lines before it? on line 497 theres the line: $linha=file('downs.txt'); then the rest of the script as below. Before this line theres simple, very simple, html. I dont understand the error. Pag ? $linha=file('downs.txt'); $t=count($linha); $l = $t - 1; $fim = $l - 3; if ($l 3) { $fim=$l - 3; } else { $fim = 0; } for ($i = $l; $i = $fim ; $i--) { $array=explode(|,$linha[$i]); print(div align=\left\); print(span class=\data\$array[0]/span); print(br$array[1]br); print(/divimg src=\spacer.gif\ height=\3\); } ? But from time to time, and with absolutely no visible reason, i get this error: Warning: php_network_getaddresses: getaddrinfo failed: No address associated with hostname in /usr/home/pagon/www/index.php on line 497 Warning: file(downs.txt) - Bad file descriptor in /usr/home/pagon/www/index.php on line 497 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] getaddrinfo failed
Sorry, i sent this to the list a few days ago, but i dont think it got there. heres my problem: Hi, i have this script that simply reads lines from a txt files and displays them on my site, itlists the first 4 entries of a txt file with the files that exist on a download page: ? $linha=file('downs.txt'); $t=count($linha); $l = $t - 1; $fim = $l - 3; if ($l 3) { $fim=$l - 3; } else { $fim = 0; } for ($i = $l; $i = $fim ; $i--) { $array=explode(|,$linha[$i]); print(div align=\left\); print(span class=\data\$array[0]/span); print(br$array[1]br); print(/divimg src=\spacer.gif\ height=\3\); } ? But from time to time, and with absolutely no visible reason, i get this error: Warning: php_network_getaddresses: getaddrinfo failed: No address associated with hostname in /usr/home/pagon/www/index.php on line 497 Warning: file(downs.txt) - Bad file descriptor in /usr/home/pagon/www/index.php on line 497 I tried everything, but i cant figure out why i get this error, the paths are ok (otherwise it wouldnt work in the first place) what could possibly cause it? The script is so small and simple, is there something wrong in it? But if it is, why does the error only appears randomly? I get this error on a different script on my site, also of the same type, reading a few lines from a txt file and displaying them. Thanks. Pag -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] getaddrinfo failed
So what's on /usr/home/pagon/www/index.php on line 497 at a few lines before it? ---John Holmes... - Original Message - From: Pag [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, June 22, 2002 9:50 PM Subject: [PHP] getaddrinfo failed Sorry, i sent this to the list a few days ago, but i dont think it got there. heres my problem: Hi, i have this script that simply reads lines from a txt files and displays them on my site, itlists the first 4 entries of a txt file with the files that exist on a download page: ? $linha=file('downs.txt'); $t=count($linha); $l = $t - 1; $fim = $l - 3; if ($l 3) { $fim=$l - 3; } else { $fim = 0; } for ($i = $l; $i = $fim ; $i--) { $array=explode(|,$linha[$i]); print(div align=\left\); print(span class=\data\$array[0]/span); print(br$array[1]br); print(/divimg src=\spacer.gif\ height=\3\); } ? But from time to time, and with absolutely no visible reason, i get this error: Warning: php_network_getaddresses: getaddrinfo failed: No address associated with hostname in /usr/home/pagon/www/index.php on line 497 Warning: file(downs.txt) - Bad file descriptor in /usr/home/pagon/www/index.php on line 497 I tried everything, but i cant figure out why i get this error, the paths are ok (otherwise it wouldnt work in the first place) what could possibly cause it? The script is so small and simple, is there something wrong in it? But if it is, why does the error only appears randomly? I get this error on a different script on my site, also of the same type, reading a few lines from a txt file and displaying them. Thanks. Pag -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php