2018년 9월 16일

CentOS7 에 ssh2 Extension for PHP 7 설치하기 (apache 기준)

사전 준비 gcc, php-devel, libssh2 and libssh2-devel on CentOS 7
php-devel 같은 경우는 php71w-devel 로 되어있는 경우도 있고, 이름이 레포에 따라 다른 경우도 있으니, 나에게 깔려있는 php 의 이름이 어떤지 한번 찾아보자..  yum list install | grep php   명령어로 내 서버의 php 이름을 알수있음.

# yum install gcc php-devel libssh2 libssh2-devel
Download php7 pecl-networking-ssh2
# wget https://pecl.php.net/get/ssh2-1.1.2.tgz
Unzip and Change folder
# tar zxvf ssh2-1.1.2.tgz
# cd ssh2-1.1.2.tgz
Building environment for SSH2 extension
# phpize
# ./configure
Make SSH2 extension make sure build success
# make
Install SSH2 extension
# make install
Write SSH2 extension in PHP 7 extension directory
# vi /etc/php.d/ssh2.ini

extension=ssh2.so
Restart apache server and php-fpm
# systemctl restart httpd

댓글 없음:

댓글 쓰기

추천 게시물

php 로 챗GPT api 사용방법. 라이브러리 그딴거 없이 누구나 쉽게

진짜 최고로 간단하게 만들어 봤습니다. 나의 php소스코드 윗부분에 다음의 함수를 붙여넣는다.  API키만 내가 받은걸로 넣기. function fnGPTComment ( $memo ) {       $api_key = '나의 API키...