array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'function.ssh2-scp-recv.php', 1 => 'ssh2_scp_recv', ), 'up' => array ( 0 => 'ref.ssh2.php', 1 => 'SSH2 関数', ), 'prev' => array ( 0 => 'function.ssh2-publickey-remove.php', 1 => 'ssh2_publickey_remove', ), 'next' => array ( 0 => 'function.ssh2-scp-send.php', 1 => 'ssh2_scp_send', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'ja', 'path' => 'reference/ssh2/functions/ssh2-scp-recv.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL ssh2 >= 0.9.0)
ssh2_scp_recv — SCP 経由でファイルを要求する
リモートサーバーからローカルファイルシステムに SCP プロトコルを使用してコピーします。
session
ssh2_connect() のコールによって取得した SSH 接続リンク ID。
remote_file
リモートファイルへのパス。
local_file
ローカルファイルへのパス。
例1 SCP 経由でのファイルのダウンロード
<?php
$connection = ssh2_connect('shell.example.com', 22);
ssh2_auth_password($connection, 'username', 'password');
ssh2_scp_recv($connection, '/remote/filename', '/local/filename');
?>