The ftp established on Ali CVM can be accessed with localhost, but not with domain name. Why?

for example, the ip address of this machine is: 123.57.XX.XX.
if you enter the domain name of ftp, the upload fails, and the error in the following figure is reported.
what is the principle that you can succeed if you fill in localhost?

$ftp_server = "123.57.XX.XX"; //
//$ftp_server = "localhost";  //

$ftp_user_name = config("ftp.ftp_account");;
$ftp_user_pass = config("ftp.ftp_password");;
$conn_id = ftp_connect($ftp_server) or die("Could not connect");
...
...
...
ftp_login($conn_id,$ftp_user_name,$ftp_user_pass);
ftp_put($conn_id,$remote_file,$tmp_name,FTP_BINARY);

clipboard.png

Jun.26,2022

to use ip, you need to go to the network to see if there is a port number that opens the current ftp in the policy group


you ping the domain name to see if it is your IP address.


your native ip is a private network ip, right?

Menu