I am having problems with uploading a file over SFTP. Here is my code:
$connection = ssh2_connect("ftp.mysite.com", 22);
ssh2_auth_password($connection, "username", "password");
$sftp = ssh2_sftp($connection);
$file = "/full/path/to/file.txt";
$stream = fopen("ssh2.sftp://{$sftp}$file", "w+");
All I get is chrome saying
No data received
Error code: ERR_EMPTY_RESPONSE
I have done phpinfo()
to check I have the ssh2.sftp wrapper enabled and I do. I am running PHP v4.4.0
and libssh2 v1.2.7
.
Any suggestions would be appreciated!