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
If the above does not work, take a look inside /etc/php5/conf.d
If you see duplicate ssh2.ini files, remove any extra ones.
In my case I had 50-ssh2.ini and ss2.ini. Both files were providing the line:
extension=ssh2.so
For me removing 50-ssh2.ini solved the issue.