|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2016-12-15 04:22 UTC] xiaqii at gmail dot com
Description:
------------
this script can work with php 7.0.6 ,but not work with 7.0.14.
my script has run with 7.0.6 for months,when i upgrade to 7.0.14,this script didn't work.
script not change.
os not change.
pecl ssh2 1.0 not change.
Test script:
---------------
$conn=ssh2_connect($host, $port);
ssh2_auth_password($conn, $username, $password);
$sftp = ssh2_sftp($conn);
$remote_file="/test.txt";
$stream = fopen("ssh2.sftp://{$sftp}{$remote_file}", 'w');
$stream got false with php7.0.14, absolute or relative path both not work.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 11:00:01 2025 UTC |
Same problem on Windows Server 2012 R2 and PHP 7.1.0 and 7.0.14. I did find a workaround for now if all you want is to download a file. ------------------ $filename = "/folder/filename.pdf"; $connection = ssh2_connect('server.com', 22); ssh2_auth_password($connection, 'username', 'password'); $tempfilename = tempnam("C:/downloads/", "tmp"); $filetransfered = ssh2_scp_recv($connection, $filename, $tempfilename); if($filetransfered) { fopen($tempfilename,'r'); } ... You may also be able to modify that file, then use ssh2_scp_send() to reupload it, changing the file you were attempting to have write access to.