Bug #78374 [NEW]: PHP Warning returned when closing FTPS connection after FTP_PUT
From: WebDevDLo at gmail dot com
Operating system: CentOS 7
PHP version: 7.3.8
Package: FTP related
Bug Type: Bug
Bug description:PHP Warning returned when closing FTPS connection after FTP_PUT
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"
--
Edit bug report at https://bugs.php.net/bug.php?id=78374&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=78374&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=78374&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=78374&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=78374&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=78374&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=78374&r=support
Expected behavior: https://bugs.php.net/fix.php?id=78374&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=78374&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=78374&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=78374&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=78374&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=78374&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78374&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78374&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78374&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78374&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=78374&r=mysqlcfg
Thread (3 messages)
- WebDevDLo at gmail dot com