Friday, November 8, 2013

SSH2 PHP Extension

SSH2 PHP Extension

SSH2 PHP Extension is a library which provide access to resources (shell, remote exec, tunneling, file transfer) on a remote machine using a secure cryptographic transport.

1. wget http://www.libssh2.org/download/libssh2-1.4.3.tar.gz
tar vxzf libssh2-1.4.3.tar.gz
cd libssh2-1.4.3
./configure
make
make install

2. wget http://pecl.php.net/get/ssh2-0.12.tgz
tar vxzf ssh2-0.12.tgz
cd ssh2-0.12
phpize
./configure --with-ssh2
make
make install

3. modify the php.ini
# vi /var/www/cgi-bin/php5-default/conf/php.ini
vi php.ini
add the "extension=ssh2.so" to the extension part of php.ini

4. check the environment of php, use phpinfo();

5. enjoy

No comments:

Post a Comment