简体   繁体   中英

PHP Warning: ftp_login(): Login with USER first

I am trying to connect and log in to my FTP server. I connect fine but when i login, ftp_login() returns false and a warning like this:

PHP Warning: ftp_login(): Login with USER first.

My code is below.

$ftp_conn = ftp_ssl_connect($ftp_server) or die("Could not connect to $ftp_server");

echo "Connected to $ftp_server\n";

$login = ftp_login($ftp_conn, $ftp_username, $ftp_userpass);

var_dump($login);
var_dump(error_get_last());

echo "Logged in to $ftp_server\n"; 

Tried to search for answers but not much information on the net.

Please help.

Thank you.

It was a firewall issue. Make sure your FTP Server's firewall allows inbound connection on the port you are trying to connect to. In my case, port 990.

Thanks.

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