PHP에서 SSH2 모듈을 사용하기 위한 방법
1. 다운로드 및 설치
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
[root@localhost ~]# wget https://pecl.php.net/get/ssh2-0.13.tgz [root@localhost ~]# tar xvfz ssh2-0.13.tgz [root@localhost ~]# cd ssh2-0.13 [root@localhost ssh2-0.13]# /usr/local/php/bin/phpize [root@localhost ssh2-0.13]# ./configure --with-ssh2 --with-php-config=/usr/local/php/bin/php-config [root@localhost ssh2-0.13]# make [root@localhost ssh2-0.13]# make install [root@localhost ssh2-0.13]# ls -l /usr/lib64/extensions/no-debug-zts-20060613/ -rwxr-xr-x 1 root root 235313 2017-08-16 16:12 ssh2.so |
2. php.ini 파일에 내용을 수정
1 2 3 4 |
[root@localhost ssh2-0.13]# vi /usr/local/apache/conf/php.ini extension_dir = "/usr/lib64/extensions/no-debug-zts-20060613/" extension=ssh2.so |
3. 확인
1 2 |
[root@localhost ssh2-0.13]# php -m | grep ssh2 ssh2 |