php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71566 cURL SFTP Transfers Extremely Slow / Timing Out
Submitted: 2016-02-10 20:22 UTC Modified: 2016-03-09 11:00 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: cphill at email dot arizona dot edu Assigned: ab (profile)
Status: Closed Package: cURL related
PHP Version: 5.6.18 OS: Windows Server 2008 R2 Standard
Private report: No CVE-ID: None
 [2016-02-10 20:22 UTC] cphill at email dot arizona dot edu
Description:
------------
Note that the script below with the CURLOPT_BUFFERSIZE commented illustrates the problem. Uncommenting the CURLOPT_BUFFERSIZE line that sets a 4096 buffer size resolves the problem. 

This appears to confirm the issue report libssh2 #50 (see https://github.com/libssh2/libssh2/issues/50). We encountered timeout failures on our sftp transfers immediately upon upgrading from PHP 5.6.17 to 5.6.18 that seems to have problems with SFTP transfers when using the default buffer size.


Test script:
---------------
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $remote);
curl_setopt($curl, CURLOPT_PROTOCOLS, CURLPROTO_SFTP);
curl_setopt($curl, CURLOPT_SSH_AUTH_TYPES, CURLSSH_AUTH_PUBLICKEY);
curl_setopt($curl, CURLOPT_SSH_PRIVATE_KEYFILE, $keysFolder.$keyFileName);         curl_setopt($curl, CURLOPT_KEYPASSWD, $password);                                  //curl_setopt($curl, CURLOPT_BUFFERSIZE, 4096);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($curl);
$info = curl_getinfo($curl);
myPrintArray($info);


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-02-19 12:11 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2016-02-19 12:11 UTC] ab@php.net
Thanks for the report. If you're interested in testing a LibSSH master build, please let me know which exact PHP build you're using.

Thanks.
 [2016-02-19 17:18 UTC] cphill at email dot arizona dot edu
-Status: Feedback +Status: Open
 [2016-02-19 17:18 UTC] cphill at email dot arizona dot edu
We are using php-5.6.18-nts-Win32-VC11-x86. Is that the information you need?
 [2016-02-23 19:52 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2016-02-23 19:52 UTC] ab@php.net
Yeah, i was asking for exactly this. Now, libssh2-1.7.0 was released, so upgrades to libssh2 and libcurl are made anyway. I made snapshots for the variant you've mentioned http://windows.php.net/downloads/snaps/ostc/71566/ , they include libssh-1.7.0 and libcurl-7.47.1. If the tests are going good, chances are to get these upgrades into the next release.

Thanks.
 [2016-02-24 18:53 UTC] cphill at email dot arizona dot edu
-Status: Feedback +Status: Open
 [2016-02-24 18:53 UTC] cphill at email dot arizona dot edu
Okay, repeated testing with php-5.6.20-dev-nts-Win32-VC11-x86 without specifying the smaller 4096 buffer size via CURLOPT_BUFFERSIZE the transfers now seem to work fine.  Thanks!
 [2016-03-09 11:00 UTC] ab@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: ab
 [2016-03-09 11:00 UTC] ab@php.net
These lib upgrades made it into 5.6.19. Thanks for the checks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 20:01:29 2024 UTC