php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78374 PHP Warning returned when closing FTPS connection after FTP_PUT
Submitted: 2019-08-05 15:53 UTC Modified: -
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: WebDevDLo at gmail dot com Assigned:
Status: Open Package: FTP related
PHP Version: 7.3.8 OS: CentOS 7
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2019-08-05 15:53 UTC] WebDevDLo at gmail dot com
Description:
------------
Using PHP version 7.3.7.

This error is similar to https://bugs.php.net/bug.php?id=77151, but that has been closed since 2018 and yet multiple comments still report an issue when doing an FTP_PUT.

To reproduce (test script included below) use ftp_ssl_connect to create a connection to an FTPS server. Set the connection to passive mode. FTP_PUT a file. Close the connection. Bang, you get the following "PHP Warning:  ftp_close(): SSL_read on shutdown: Connection reset by peer"

One theory, although I have not researched this, is I wonder if there is a difference when using SFTP vs FTPS. Regardless, the FTPS server is what I have to work with and is still a relevant protocol.

Appreciate any attention this gets! I don't want to workaround this by ignoring PHP Warnings. Thank you.

Test script:
---------------
<?php
$conn = ftp_ssl_connect('ftps.host');

            if ($conn) {
                $login_result = ftp_login($conn, 'user', 'pass');
                $set_passive = ftp_pasv($conn, true);
            }
            else {
                throw new Exception('Could not connect to FTP service.');
            }

ftp_chdir($conn, 'stage'); // change directory
ftp_put($conn, 'test.txt', 'test.txt', FTP_ASCII); // put file
ftp_close($conn);


Expected result:
----------------
I expect to see no output.

Actual result:
--------------
PHP returns: "PHP Warning:  ftp_close(): SSL_read on shutdown: Connection reset by peer"

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 12:01:22 2019 UTC