What could be causing the "Login incorrect" error in the PHP FTP script?

The "Login incorrect" error in a PHP FTP script could be caused by incorrect login credentials, such as the username or password being wrong. To solve this issue, double-check the login credentials being used in the script to ensure they are correct.

<?php
$ftp_server = "ftp.example.com";
$ftp_username = "your_username";
$ftp_password = "your_password";

$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_username, $ftp_password);

if ($login_result) {
    echo "Login successful";
} else {
    echo "Login incorrect";
}

ftp_close($conn_id);
?>