如何将一个服务器的tgz文件复制到另一个Linux服务器?

I have one file example.tgz hosted in one linux server and I want to copy this file (example.tgz) to another linux server.

How can we copy example.tgz file from one server to another server please suggest.

Try This code:

 <?php
  $connection = ssh2_connect('otherserver.com', 22);
  ssh2_auth_password($connection, 'username', 'password');

  ssh2_scp_send($connection, '/local/example.tgz', '/remote/example.tgz', 0644);
 ?>

Please run this code from local, it copy example.tgz files into /remote/ folder.