|  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: 2021-09-07 09:01 UTC
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: Verified Package: FTP related
PHP Version: 7.4 OS: CentOS 7
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.
Block user comment
Status: Assign to:
Bug Type:
From: WebDevDLo at gmail dot com
New email:
PHP Version: OS:


 [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

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-08-12 11:32 UTC]
-Status: Open +Status: Verified -PHP Version: 7.3.8 +PHP Version: 7.4 -Assigned To: +Assigned To: cmb
 [2021-08-12 11:32 UTC]
I can reproduce this with PHP-7.4 with IIS.
 [2021-08-12 11:32 UTC]
The following pull request has been associated:

Patch Name: Fix #78374: Warning when closing FTPS connection after FTP_PUT
On GitHub:
 [2021-09-07 09:01 UTC]
-Assigned To: cmb +Assigned To:
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 22 17:01:29 2024 UTC