array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'function.ssh2-sftp.php', 1 => 'ssh2_sftp', ), 'up' => array ( 0 => 'ref.ssh2.php', 1 => 'SSH2 関数', ), 'prev' => array ( 0 => 'function.ssh2-sftp-unlink.php', 1 => 'ssh2_sftp_unlink', ), 'next' => array ( 0 => 'function.ssh2-shell.php', 1 => 'ssh2_shell', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'ja', 'path' => 'reference/ssh2/functions/ssh2-sftp.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL ssh2 >= 0.9.0)
ssh2_sftp — SFTP サブシステムを初期化する
このメソッドは全ての他の ssh2_sftp_*() や
ssh2.sftp:// fopen
ラッパーで使用する SSH2 SFTP
リソースを返します。
失敗した場合に false
を返します
例1 SFTP 経由でのファイルのオープン
<?php
$connection = ssh2_connect('shell.example.com', 22);
ssh2_auth_password($connection, 'username', 'password');
$sftp = ssh2_sftp($connection);
$stream = fopen('ssh2.sftp://' . intval($sftp) . '/path/to/file', 'r');
?>