php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5471 ftp_login warning message produced when it shouldn't be
Submitted: 2000-07-08 21:36 UTC Modified: 2000-08-05 00:55 UTC
From: kevfinn at epitaph dot com Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0 Latest CVS (08/07/2000) OS: RedHat Linux 6.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kevfinn at epitaph dot com
New email:
PHP Version: OS:

 

 [2000-07-08 21:36 UTC] kevfinn at epitaph dot com
I have the ftp functions working with my PHP 4.0.1pl2 setup but I'm running into an error message that is produced when it should not be.  

The problem arises with FTP logins exceed the specified simultaneous connections allowed by my server (by way of the /etc/ftpaccess file).  When connecting to an FTP server that has exceeded the number of connections, ftp_connect connects, just as a command line FTP session would, but ftp_login fails (a command line FTP session would return the warning message provided by the server that the maximum number of connections has been exceeded), but the documentation states that ftp_login would return a false value upon failure.  Instead it returns the error message :
"Warning: ftp_login: Login incorrect. in /usr1/websites/epitaph.com/htdocs/temp/ftp.php on line 5"
Had it returned a zero as specified in the documentation, then I could produce an appropriate error message, instead I do not have that ability.  Here's the sample code that I was working with :

<?PHP
        $ftp    = ftp_connect ( "skunk.epitaph.com" );

        if ( ftp_login ( $ftp, 'anonymous', 'test@epitaph.com' ) )
        {
                echo "yep";
        }
        else
        {
                echo "nope";
        }
 
        ftp_quit ( $ftp );
?>
                    
If the maximum limit of FTP users has not been met then the output of the code is :
yep
but if the limit has been exceeded the PHP created warning message is sent without my control.  I believe the function ftp_login should produce the proper false value and nothing else.


Kevin
kevfinn@epitaph.com

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-05 00:55 UTC] sniper@php.net
From php-manual, ftp_login: 

int ftp_login (int ftp_stream, string username, string password)

                     Returns true on success, false on error.

                     Logs in the given FTP stream.

Use @ftp_login and the error message disappears magically! =)
Or change php.ini directives for error displaying. 

Please read the friendly manual next time before submitting bug report.

--Jani
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 10:01:33 2025 UTC