Re: Hoping for a working example of SFTP in PHP
[email protected] ("R. Eric Wheeler")
| Newsgroups | php.general |
|---|---|
| Message-ID | <[email protected]> |
David, After looking at the previous emails and this error message - "Warning: copy(ssh2.sftp//6/home/nsr/public_html/test.txt): failed to open stream: No such file or directory in C:\Dropbox\Private\Web\nsr-HMAC\upload\Wheeler-2.php on line 67 Failed to copy local file 'C:\Dropbox\Private\Web\nsr-HMAC\upload\test.txt' to remote file 'ssh2.sftp//6/home/nsr/public_html/test.txt' " I noticed that the sftp stream url is missing the colon. You have ssh2.sftp//6/home/nsr/public_html/test.txt, but it should be ssh2.sftp://6/home/nsr/public_html/test.txt I think this is the problem. Eric On 2/7/21 2:16 PM, David Spector wrote: > They look correct to me: > > local file C:\Dropbox\Private\Web\nsr-HMAC\upload\test.txtremote > /home/nsr/public_html/test.txt > > I've been debugging by printing out values all throughout the past few > weeks of working on these examples. The only frustration is that our > network environment is like black boxes. We don't have the feedback > from SFTP and security processes to know exactly what's going on > behind the simple "copy" function. All we know is that it doesn't work. > > The experts, who know all this stuff inside-out, don't care to share > their knowledge, so far as I can tell. There's probably just one > little twist of knowledge omitted that is keeping us from success. > > I guess at some point I have to give up on "copy" and just use the > ssh2_scp_send function. > > A big failure for PHP documentation and error messages, which should > both help a programmer achieve success. I did much better than this in > my own systems and tools programming during my 40 year career as a > software engineer. > > Thanks, Eric, for all your help. > > David