Hi,
I am developing an application which should be capable of uploading files to several other sites. But in all target sites regular FTP is blocked due to security reasons and so, and only SFTP allowed.
Son in that case I need to handle SFTP functions, instead of regular FTP functions. I tried with php ssh2 functions, but it says functions not defined, so I believe some additional php library might be needed. I checked OpenSSL is available in server.
The following is the (sample) code I used.
[code=php]<?php
$connection = ssh2_connect(‘shell.example.com’, 22);
ssh2_auth_password($connection, ‘username’, ‘password’);
$sftp = ssh2_sftp($connection);
$stream = fopen(“ssh2.sftp://$sftp/path/to/file”, ‘r’);
?>
It ends prematurely with ssh2_connect as it doesnt recognize function ssh2_connect()
Can someone please guide me for what I need to look for further to make SFTP functions working..
Also, can anyone suggest me an alternative file transfer approach..
Thanks and Best Regards
Indunil