Warning during SCP transfer in PHP -
i transfer files remote server using scp follows:
$connection = ssh2_connect('shell.example.com', 22); ssh2_auth_password($connection, 'username', 'password'); ssh2_scp_send($connection, '/local/filename', '/remote/filename', 0644);
for servers works fine. 1 remote server had problem transfered file, has been marked incomplete.
i found solution in files sent ssh2_scp_send() incomplete on remote server.
i had add
ssh2_exec($connection, 'exit');
however, after made change, other remote servers seem not support exit command. result in php warning:
php warning: ssh2_exec(): unable request command execution on remote host in file.php on line xx
does know solution problem? could, obviously, ignore or supress warning. somehow feels wrong, especialy since rest of code notice free.
can scp via cli server giving error message?:
php warning: ssh2_exec(): unable request command execution on remote host in file.php on line xx
could ssh2_scp_send()
doing it's thing via shell , ssh2_exec()
doing through system exec
call (they're different things) , server supports 1 not other. being able see logs phpseclib's scp implementation provides them helpful, alas, libssh2 not generate logs..
Comments
Post a Comment