CentOS php-pecl-ssh2 설치

Jmnote bot (토론 | 기여)님의 2020년 11월 2일 (월) 00:40 판 (봇: 자동으로 텍스트 교체 (-<source +<syntaxhighlight ))
PHP에서 SSH2 터널링 사용
리눅스 php-pecl-ssh2 설치

1 확인

<syntaxhighlight lang='console'> [root@zetawiki ~]# rpm -qa | grep php-pecl-ssh2 [root@zetawiki ~]# php -r "ssh2_tunnel();" PHP Fatal error: Call to undefined function ssh2_tunnel() in Command line code on line 1

Fatal error: Call to undefined function ssh2_tunnel() in Command line code on line 1 </source>

→ ssh2_tunnel 명령어를 인식하지 못함.

<syntaxhighlight lang='console'> [root@zetawiki ~]# yum list php-pecl-ssh2 ... (생략) Error: No matching Packages to list </source>

→ yum으로 설치 불가

2 epel-release 설치

3 php-pecl-ssh2 설치

<syntaxhighlight lang='console'> [root@zetawiki ~]# yum install php-pecl-ssh2 ... (생략)

3.1 =======================================================================================================================
Package                            Arch                        Version                            Repository                 Size
3.2 =======================================================================================================================

Installing:

php-pecl-ssh2                      x86_64                      0.11.0-7.el6                       epel                       31 k

Transaction Summary

3.3 =======================================================================================================================

Install 1 Package(s)

Total download size: 31 k Installed size: 73 k Is this ok [y/N]: y </source> <syntaxhighlight lang='console'> ... (생략) Installed:

 php-pecl-ssh2.x86_64 0:0.11.0-7.el6                                                                                              

Complete! </source>

4 확인 2

<syntaxhighlight lang='console'> [root@zetawiki ~]# rpm -qa | grep php-pecl-ssh2 php-pecl-ssh2-0.11.0-7.el6.x86_64 </source> <syntaxhighlight lang='console'> [root@zetawiki ~]# php -r "ssh2_tunnel();" PHP Warning: ssh2_tunnel() expects exactly 3 parameters, 0 given in Command line code on line 1

Warning: ssh2_tunnel() expects exactly 3 parameters, 0 given in Command line code on line 1 </source>

→ PHP 모듈이 ssh2_tunnel 함수를 인식하였다.
  • 웹에도 적용하려면 아파치를 재시작해야 한다.

<syntaxhighlight lang='console'> [root@zetawiki ~]# service httpd restart Stopping httpd: [ OK ] Starting httpd: [ OK ] </source>

5 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}