SSH2 ssh2_fetch_stream
(PECL ssh2 >= 0.9.0)
ssh2_fetch_stream — 확장 데이터 스트림 가져오기
설명
ssh2_fetch_stream(resource $channel
, int $streamid
): resource
SSH2 채널 스트림과 연결된 대체 서브스트림을 가져옵니다. SSH2 프로토콜은 현재 하위 스트림 ID가 SSH2_STREAM_STDERR
(1로 정의됨)인 STDERR을 하나만 정의합니다.
매개변수
channel
streamid
- SSH2 채널 스트림.
반환 값
요청된 스트림 리소스를 반환합니다.
Examples
예제 #1 셸 열기 및 관련 stderr 스트림 검색
<?php
$connection = ssh2_connect('shell.example.com', 22);
ssh2_auth_password($connection, 'username', 'password');
$stdio_stream = ssh2_shell($connection);
$stderr_stream = ssh2_fetch_stream($stdio_stream, SSH2_STREAM_STDERR);
?>
기타
- ssh2_shell() - 대화형 셸 요청
- ssh2_exec() - 원격 서버에서 명령 실행
- ssh2_connect() - SSH 서버에 연결