• 欢迎访问小杰博客网站
  • 欢迎访问小杰博客网站哦

Ubuntu / Debian: Install PHP-SSH2 ( php-ssh ) extension

未分类 小杰 9年前 (2014-12-26) 1063次浏览 已收录 0个评论

之前小杰写php程序时纠结过ssh2的安装问题,现在分享下经验:

Install PHP-SSH2 ( php-ssh ) extension

Install Build Dependancies

Shell

1

apt-get install libssh2-1 libssh2-1-dev

Download ssh2 files

Shell

1
2
3

cd /tmp
wget http://pecl.php.net/get/ssh2-0.12.tgz
tar -zxvf ssh2-0.12.tgz

Compile and Install

Shell

1
2
3
4

cd ssh2-0.12
phpize
./configure –with-ssh2
make && make install

Configure php-ssh2

Shell

1

echo -e “\n\n[php-ssh2]\n;http://pecl.php.net/package/ssh2\nextension=ssh2.so\n\n” >> /etc/php5/mods-available/ssh2.ini

Enable php-ssh2

Shell

1

ln -s /etc/php5/mods-available/ssh2.ini /etc/php5/conf.d/20-ssh2.ini

Restart PHP5-fpm to apply the config

Shell

1

service php5-fpm restart



小杰博客 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:Ubuntu / Debian: Install PHP-SSH2 ( php-ssh ) extension
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址