note 51987 deleted from function.fopen by danbrown
| From: | danbrown@php.net | Date: | Mon, 08 Jun 2009 23:41:25 +0000 |
| Subject: | note 51987 deleted from function.fopen by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-156566@lists.php.net to get a copy of this message | ||
Note Submitter:
----
This only relavant to those opening a remote file for writing using the PECL SSH2 for SFTP paths for
the string filename. Since SFTP has variations, most of which are non-secure, using this module is
the only viable solution. The optional FTP extension class that uses the function
'ftp_ssl_connect' uses openssl, which only encrypts the communication requests and not the
data - or something close to that. At any rate, many systems will not allow connection to their
SFTP server using this method.
I think it's worth mentioning that some of the examples provided in various areas failed
consistantly using the syntax given, using both possible methods of.
ssh2.sftp://$sftp/example.com/path/to/file
ssh2.sftp://user:pass@$sftp/example.com/path/to/file
It's just a small adjustment to correct this, but as most coding goes, a long road to find a
stupid little oversight. Apparently it is necessary to supply the port as well in the path. Could
just be the few systems I was testing against, but that would be three separate networks using three
separate platforms (Windows Server, Linux, Unix). At any rate, the following works like a charm,
and was very simple to install the libssh2 library and PECL SSH2 module required to use this system.
Gotta love PHP.
ssh2.sftp://$sftp/example.com:22/path/to/file
ssh2.sftp://user:pass@$sftp:22/example.com/path/to/file
Hope this saves anyone some headache and time.