I use the functions below to copy files from one server to another. It works most of the time, but sometimes I start getting this error in log files:
Module
The error message Module 'ssh2' already loaded in Unknown on line 0
means that there's something off in your PHP configuration. Check to see if there's a line that says extension=ssh2.so
in your php.ini. If so, remove it and check if everything is still working. Possibly, the extension=ssh2.so is loaded twice, meaning PHP will complain that the module is already loaded.
Good luck.