Linux ==================================
yum install gcc
yum install php-devel
yum install php-pear
yum install openssl
yum install openssl-devel
libssh2:
wget http://www.libssh2.org/download/libssh2-1.2.7.tar.gz
tar -zxvf libssh2-1.2.7.tar.gz
cd libssh2-1.2.7
./configure && make all install
ssh2 for php:
1.產生 ssh2.so (下列方式二擇一即可)
(1).
pecl install -f ssh2
(ssh2.so 應該會自動產生於 php 的 extension 目錄下)
(2).
wget http://pecl.php.net/get/ssh2-0.11.2.tgz
tar -zxvf ssh2-0.11.2.tgz
cd ssh2-0.11.2.tgz
phpize && ./configure –with-ssh2 && make
(ssh2.so 應該會產生於當前目錄的 modules下面)
cp ./modules/ssh2.so /usr/lib/php/modules/ssh2.so
2. 修改 php.ini
vi /etc/php.ini
extension=ssh2.so
如果產生下列錯誤訊息:
configure: error: cannot find OpenSSL or Libgcrypt,
try --with-libssl-prefix=PATH or --with-libgcrypt-prefix=PATH
可能是 openssl 或 openssl-devel 套件沒裝,
請給它 yum install
Windows IIS ==================================
下載 php_ssh2.dll
放到 php\ext 目錄
修改 php.ini
extension=php_ssh2.dll
參考文章:
http://hi.baidu.com/shuxiaotu/blog/item/7c464e5186090f551038c294.html
http://blog.zjs.tw/?p=179
沒有留言:
張貼留言