I am making use of php ssh2_scp_send to transfer files to the remote machine, but it is a bit weird, it works for the first time but fails my second call with the following error
//success for file transfer
if (!(ssh2_scp_send($this->conn, $lpath, $rpath, 0777))){
throw new Exception("File transfer failed!");
}
ssh2_exec($this->conn, 'exit');
//fail this time
if (!(ssh2_scp_send($this->conn, $lpath, $rpath, 0777))){
throw new Exception("File transfer failed!");
}
ssh2_exec($this->conn, 'exit')
"Warning: ssh2_scp_send(): Failed copying file in /var/www/trunk/rsetting/class/ssh.class.php on line 57"
Any help will be appreciated~Thanks