I’m trying to make an FTP connection to 3 web sites on the same server via a PHP script. It works fine for 2 of the sites, but the 3rd I get the following error (and it doesn’t appear to be temporary):
“Warning: ftp_connect() [function.ftp-connect]: php_network_getaddresses: getaddrinfo failed: This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server”
This code snippet is where it fails:
$server = 'ftp.'.$ftp_server;
$conn_id = ftp_connect($server) OR die("<br>unable to establish an FTP connection");
I’m hoping someone can point me in the right direction.
Regards to all
That means the DNS lookup for the ftp server’s name (e.g.
example.com) failed to resolve and the IP address could not be determined.This could either be from your remote site’s DNS servers being down, or the domain itself is misconfigured and is pointing at non-existing/unreachable DNS servers.