php安裝ssh2擴(kuò)展的方法(Linux平臺(tái))

字號(hào):


    本文實(shí)例講述了php安裝ssh2擴(kuò)展的方法。分享給大家供大家參考,具體如下:
    wget http://www.libssh2.org/download/libssh2-1.4.2.tar.gz
    tar -zxvf libssh2-1.4.2.tar.gz
    cd libssh2-1.4.2
    ./configure --prefix=/usr/local/libssh2
    make && make install
    wget http://pecl.php.net/get/ssh2-0.12.tgz
    tar -zxvf ssh2-0.12.tgz
    cd ssh2-0.12
    phpize
    ./configure --prefix=/usr/local/ssh2 --with-ssh2=/usr/local/libssh2 --with-php-config=/usr/local/php/bin/php-config
    make
    #復(fù)制到php的擴(kuò)展目錄
    cp moduels/ssh2.so /usr/local/php/lib/php/extensions/no-debug-zts-20090626
    /usr/local/php/sbin/php-fpm -t
    /etc/init.d/php-fpm restart
    希望本文所述對(duì)大家PHP程序設(shè)計(jì)有所幫助。