CentOS php-pecl-ssh2 설치

PHP에서 SSH2 터널링 사용
리눅스 php-pecl-ssh2 설치

1 확인[ | ]

[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
→ ssh2_tunnel 명령어를 인식하지 못함.
[root@zetawiki ~]# yum list php-pecl-ssh2
... (생략)
Error: No matching Packages to list
→ yum으로 설치 불가

2 epel-release 설치[ | ]

3 php-pecl-ssh2 설치[ | ]

[root@zetawiki ~]# yum install php-pecl-ssh2
... (생략)
===================================================================================================================================
 Package                            Arch                        Version                            Repository                 Size
===================================================================================================================================
Installing:
 php-pecl-ssh2                      x86_64                      0.11.0-7.el6                       epel                       31 k

Transaction Summary
===================================================================================================================================
Install       1 Package(s)

Total download size: 31 k
Installed size: 73 k
Is this ok [y/N]: y
... (생략)
Installed:
  php-pecl-ssh2.x86_64 0:0.11.0-7.el6                                                                                              

Complete!

4 확인 2[ | ]

[root@zetawiki ~]# rpm -qa | grep php-pecl-ssh2
php-pecl-ssh2-0.11.0-7.el6.x86_64
[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
→ PHP 모듈이 ssh2_tunnel 함수를 인식하였다.
  • 웹에도 적용하려면 아파치를 재시작해야 한다.
[root@zetawiki ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

5 같이 보기[ | ]

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