简体   繁体   中英

ftp_login() error

I have a big error. This is my ftp_connect() PHP code.This code work my localhost but does not work my host (Centos 5.8)

$ftp_username="username";
$ftp_password="pass";
$ftp_host="212.***.***.149";
$ftp_id=ftp_connect($ftp_host);
$ftp_connect=ftp_login($ftp_id,$ftp_username,$ftp_password);

if((!$ftp_id) || (!$ftp_connect))
{
   die("FTP connect error");
}
else
{
   echo "ok";
}

Warning: ftp_login() [function.ftp-login]: Not logged in, unauthorized IP address. in /home/sektorel/public_html/xml1.php on line 230

anyone have a solution?

As per the error, your FTP server only allows logins from a range of pre-authorised IP addresses. Your server address is not on there. Find out the publicly facing IP(s) of the server, and add it/them to the FTP authorisation list.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM