|  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: -
Avg. Score:3.4 ± 1.0
Reproduced:5 of 5 (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
Using PHP version 7.3.7.

This error is similar to, 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:
$conn = ftp_ssl_connect('');

            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

Expected result:
I expect to see no output.

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


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Jun 23 07:01:23 2021 UTC