you will have an issue transferring any file using ssh2_scp_send unless you send a dummy file after your real file, or preferably issue an
ssh2_exec ($connection, 'exit');
I was transferring hundreds of thousands of files in my prototype across multiple servers, and noticed that each file had a mismatched md5 hash and bytelength.
after a bit of research i learnt that this was a bug, and added the code above as suggested at pecl.php.net in the bugs section.
hopefully this helps someone who is getting partial file transfer that could ruin your whole app.