ubuntu - PHP ssh2.sftp stopped working -
below code that's been running quite time , week stopped working. i've narrowed down line fails on 'fopen' statement. proper echos if comment fopen line out. @ first thought rights problem on remote server, had same thing happen different server well.
i not getting error message. browser message page cannot load.
this running on php 5.5.9 on ubuntu server. did receive updates number of php packages ubuntu on 8/11.
here code:
$connection = ssh2_connect('fe01.xyz.com', 22); if (!$connection) die('connection failed'); echo "connected<br>"; $u=ssh2_auth_password($connection, 'username', 'password'); if (!$u) : echo "auth failed "; exit; else: echo "auth success<br>"; endif; $outdata=file_get_contents("files/ulti99.csv"); $ressftp = ssh2_sftp($connection); if (!$ressftp): echo "sftp connection failed"; exit; else: echo "sftp connection succuess<br>"; endif; $resfile = fopen("ssh2.sftp://{$ressftp}/ulti99.csv", 'w'); // failing echo "after open"; fwrite($resfile, $outdata ); fclose($resfile); any appreciated.
maybe changed file permissions in server.
Comments
Post a Comment