Re: Hoping for a working example of SFTP in PHP

[email protected] (David Spector)
Newsgroups php.general
Message-ID <[email protected]>
Dear R. Eric Wheeler,

I just can't get the first approach to work (ssh2_connect, 
ssh2_auth_pubkey_file, ssh2_sftp, copy,

using either of these exact wrappers (6 is the ssh2_stfp resource):

ssh2.sftp://6/test.txt

or

ssh2.sftp://6/public_html/test.txt

With the test.txt file existing in both the document root and 
public_html directories on the remote computer, the file_exists function 
keeps returning false even though I added a call to clearstatcache. My 
PHP.ini file has wrappers enabled and the SSH2 extension is installed.

And the copy function is even worse: it times out in the browser.

The second approach works successfully (ssh2_connect, ssh2_scp_send).

If you can't help me with with the first approach, I'll drop it. But I 
would like to offer my readers both alternatives.

David
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.