php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33995 wrong WARNING message
Submitted: 2005-08-04 15:09 UTC Modified: 2005-08-13 20:57 UTC
From: zxc at zmail dot ru Assigned:
Status: Not a bug Package: FTP related
PHP Version: 4.4.0 OS: Win2000 SP4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: zxc at zmail dot ru
New email:
PHP Version: OS:

 

 [2005-08-04 15:09 UTC] zxc at zmail dot ru
Description:
------------
I have a WARNING message from ftp_login(), but I use a "@" with ftp_login() function.

Function ftp_login() in this case must returns boolean FALSE only without WARNING.

Reproduce code:
---------------
<?
$ftp=ftp_connect("myFTPserver");
@ftp_login("login","password");

 if($ftp)
 ftp_close($ftp);
?>

Expected result:
----------------
I have a WARNING message from ftp_login(), but I use a "@" with ftp_login() function.

Function ftp_login() in this case must returns boolean FALSE only without WARNING.

Actual result:
--------------
empty screen

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-04 15:18 UTC] tony2001@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.


What warning? Which FTP server do you use? How to reproduce it? Are you able to reproduce it if you change your FTP server to something else?
 [2005-08-04 19:56 UTC] zxc at zmail dot ru
Example of WARNING:

--
Warning: ftp_login(): Too many users - please try again later. in /pub/home/hissite/ftpconnect.php on line 73
--

Why shows a WARNING message? I use a "@" prefix before "ftp_login()" function. 

>>> I must have boolean FALSE only, without this WARNING.
 [2005-08-04 19:59 UTC] zxc at zmail dot ru
Tony, I has tried change a FTP server to something, but I show WARNING still.
 [2005-08-04 22:12 UTC] sniper@php.net
You have to provide a working script. The one here can not work: ftp_login() expects 3 parameters, not 2..

(and I can't reproduce this with a proper script, even if the server shows errors)

 [2005-08-05 19:34 UTC] zxc at zmail dot ru
sniper, I use 3 parameters:

<?
$ftp=ftp_connect("myFTPserver");
@ftp_login($ftp,"login","password");

 if($ftp)
 ftp_close($ftp);
?>

I have WARNING message (from "ftp_login()" function) if remote FTP server is FULL (many users etc.)

But I must have boolean FALSE only from ftp_login() function in this case (without WARNING message), because I use prefix "@" before "ftp_login()".
 [2005-08-05 19:42 UTC] tony2001@php.net
What FTP server do you use? (software name, version etc.)
Is it a public server? Can you give us it's IP/hostname? And probably we'll need an account there too, if it rejects anonymous logins.

 [2005-08-07 14:06 UTC] zxc at zmail dot ru
Tony, it's very hard because all ftp servers are in private LAN.
 [2005-08-07 14:25 UTC] sniper@php.net
Can you at least tell us WHAT ftp server software is it?!

 [2005-08-08 08:18 UTC] zxc at zmail dot ru
sniper, how I show this WARNING again, I tell you FTP server software.

I don't tell you it now because LAN has many different FTP server softwares.
 [2005-08-08 08:56 UTC] sniper@php.net
This isn't getting anywhere and as neither me or Tony can reproduce this with latest CVS -> bogus.

 [2005-08-13 20:35 UTC] zxc at zmail dot ru
Hi, Tony.
Hi, Sniper.

I has understood what was it:

--
Example #1:
<?
$ftp=ftp_connect("remoteFtpServer.domain");

// I using not existing account to connect.
var_dump(ftp_login($ftp,"unknown","user"));
?>

Actual result is: bool(false) with WARNING message (WARNING: ftp_login(): Not logged in, user or password incorrect!). It's right.

--
Example #2:
<?
$ftp=ftp_connect("remoteFtpServer.domain");

// I using not existing account to connect.
var_dump(@ftp_login($ftp,"unknown","user"));
?>

Actual result is: bool(false) WITHOUT WARNING message (WARNING: ftp_login(): Not logged in, user or password incorrect!), but I use a "@" before ftp_login() function. It's right.

--
Example #3:
<?
function errHandler($errNum,$errStr,$errFile,$errLine)
{
}

set_error_handler("errHandler");

$ftp=ftp_connect("remoteFtpServer.domain");

// I using not existing account to connect.
var_dump(@ftp_login($ftp,"unknown","user"));
?>

Actual result is: bool(false) WITHOUT WARNING message (WARNING: ftp_login(): Not logged in, user or password incorrect!), but I use a "@" before ftp_login() function and in errHandler() function I did not define string fot E_WARNING level. It's right.

--
Example #3:
<?
function errHandler($errNum,$errStr,$errFile,$errLine)
{
   switch($errNum)
   {
   case E_WARNING:
   echo "Warning: ...place for original WARNING message...";
   break;
   }
}

set_error_handler("errHandler");

$ftp=ftp_connect("remoteFtpServer.domain");

// I using not existing account to connect.
var_dump(@ftp_login($ftp,"unknown","user"));
?>

Actual result is: bool(false) > WITH  WARNING < message (WARNING: ftp_login(): Not logged in, user or password incorrect!) from errHandler() ftunction, but I use a "@" before ftp_login() function and in errHandler() function I did define string fot E_WARNING level. It's wrong. But I read manual strings:

"It is important to remember that the standard PHP error handler is completely bypassed. error_reporting() settings will have no effect and your error handler will be called regardless - however you are still able to read the current value of error_reporting and act appropriately. Of particular note is that this value will be 0 if the statement that caused the error was prepended by the @ error-control operator."

And now I think It's maybe right.
 [2005-08-13 20:57 UTC] zxc at zmail dot ru
Oh, 2nd "Example #3" is actual Example #4.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 15:01:28 2024 UTC