What is the potential cause of the error message "ftp_connect() [function.ftp-connect]: php_network_getaddresses: getaddrinfo failed: Name or service not known" in the provided PHP script?

The error message "ftp_connect() [function.ftp-connect]: php_network_getaddresses: getaddrinfo failed: Name or service not known" typically indicates that the PHP script is unable to resolve the hostname provided for the FTP connection. This could be due to a DNS resolution issue or incorrect hostname. To solve this issue, ensure that the hostname is correct and can be resolved by the DNS server.

// Correct the hostname for the FTP connection
$ftp_server = 'ftp.example.com';

// Connect to FTP server
$conn_id = ftp_connect($ftp_server);
if (!$conn_id) {
    die('Unable to connect to FTP server');
}