Does the login on the FTP server you are connected to. for that you first have to connect to a FTP server before logging in. Username and Password can either be set by the parameters or manually before (using the set-methods).
string $username = null - The username to be used for login to. This parameter can be left out, if it has been set manually!
int $password = null - The password to use for login. This parameter can be left out, if it has been set manually!
The returned PEAR_Error object in case of an error is unspecific. You can ignore the errornumber and errormessage, because only "Login failed" will be returned if the login fails.