I am attempting to use ftp_login()
but continue to get the error:
Warning: ftp_login(): Login authentication failed in /path/to/file.php
I am 100% positive that the username and password are correct. Login succeeds when using an FTP client like WinSCP or FileZilla. There are no symbols in either the password or username.
Here's the code:
$ftp_host = 'host.com';
$ftp_user_name = '[email protected]';
$ftp_user_pass = 'password';
$connect = ftp_connect( $ftp_host ) or die( "Couldn't connect to server!!!" );
$login_result = ftp_login( $connect, $ftp_user_name, $ftp_user_pass );
I am using HostGator and I am trying to transfer files this domain to a sub-domain also with HostGator.
Please help. Thanks!
Try dropping @host.com from your $ftp_user_name string.
Use this to see if your credentials are correct:
Note, this code will show errors.