I am trying to upload image file to remote server using php, i am able to make ftp connection successfully, but cannot login using ftp_login, it gives me error as Fatal error:
php
require_once('../rmconn.php');
$ftp_conn = ftp_connect($rmhost, 21) or trigger_error(mysqli_connect_error(), E_USER_ERROR);
$ftp_login = @ftp_login($ftp_conn, $user, $pass) or trigger_error(mysqli_error($rmconn), E_USER_ERROR);
ftp_pasv($ftp_conn, true);
if ($ftp_login) {
echo "Connected as $user@$rmhost\n";
} else {
echo "Couldn't connect as $user";
}
ftp_close($ftp_conn);
Please see and suggest any possible way do this.
Thanks.
Probably the problem lies here:
Specifically in the
mysqli_errorpart. Replace like this:I also removed the
@beforeftp_login. While debugging, you should suppress warnings and errors.