ftp_connect will return false if this fails. This will result in the error message you are experiencing instead of logging in.
I would recommend using a condition so as not to try to log in when your connection failed.
A couple of options that you have:
// set up a connection to ftp server $conn_id = ftp_connect("thelegendmaker.net") or die("Unable to connect to server."); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
or
// set up a connection to ftp server $conn_id = ftp_connect("thelegendmaker.net"); // login with username and password if($conn_id !== false) $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
Since I get a response from your server to ping. I assume that you have configured your FTP server incorrectly.
source share