Voting

: max(five, seven)?
(Example: nine)

The Note You're Voting On

emmanuel dot kartmann at prosdk dot com
15 years ago
On Windows, I had trouble using ssh2_scp_send: files copied to a remote server where incomplete (truncated) and/or locked (error message : "access denied"). The back-end is also on Windows, using CopSSH (cygwin-based SSH server).

The SSH session was kept open - and the file were never flushed to disk.

There's a workaround though - make an explicit call to "exit" to close the session (flushing file content to disk):

<?php
$objConnection
= ssh2_connect($strHost, $strPort, $methods, $callbacks);
ssh2_auth_password($objConnection, $strUser, $strPassword);
ssh2_scp_send($objConnection , $strSource, $strDest);

// Add this to flush buffers/close session
ssh2_exec($objConnection, 'exit');
?>

<< Back to user notes page

To Top