Bug #79100 [PATCH]: PHP Warning: and ftp_get() returns false
| From: | cmb@php.net | Date: | Tue, 23 Feb 2021 11:38:33 +0000 |
| Subject: | Bug #79100 [PATCH]: PHP Warning: and ftp_get() returns false | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-232342@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79100&edit=1
ID: 79100
Patch added by: cmb@php.net
Reported by: brainforge dot uk at btinternet dot com
Summary: PHP Warning: and ftp_get() returns false
Status: Verified
Type: Bug
Package: FTP related
Operating System: Centos 7
PHP Version: 7.3.13
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
The following pull request has been associated:
Patch Name: Fix #79100: Wrong FTP error messages
On GitHub: https://github.com/php/php-src/pull/6718
Patch: https://github.com/php/php-src/pull/6718.patch
Previous Comments:
------------------------------------------------------------------------
[2021-02-19 18:27:34] cmb@php.net
FTP errors are reported via the usual PHP error reporting
mechanism, so the warnings are available via error_get_last().
However, in case of timeout, you always get the last message from
the FTP server, what is of course wrong.
------------------------------------------------------------------------
[2020-01-11 16:13:07] brainforge dot uk at btinternet dot com
Problem appears to be related to timeout.
The default is 90 seconds.
ftp_set_option($conn_id, FTP_TIMEOUT_SEC, $timeout)
Something confusing here - the message should indicate timeout occurred.
Also in the particular instance the resulting file is sometimes complete!
ftp_get() needs something more than just TRUE or FALSE result - or another function to check the
result operation detail such as ftp_status().
------------------------------------------------------------------------
[2020-01-11 12:50:16] brainforge dot uk at btinternet dot com
Description:
------------
In PHP 7.3 get the following warning:
PHP Warning: ftp_get(): Opening data channel for file download from server of "???" in
???.php on line ???
Works fine in PHP 7.2.
Program fails with error and warning message in PHP 7.3
File size 4.5MB
Test script:
---------------
if (ftp_get())
{
echo 'Everything OK';
}
else
{
die('Help!!!');
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79100&edit=1