星期一, 8月 12, 2013

Install ssh2 for PHP without YUM on RHEL

為了裝個ssh2 for php 得額外安裝一堆...
幸好rpmfind還挺好用的...
不然都要放棄了...

安裝流程照官網上寫的 - CentOS 6.2 64bit Installation Steps
  1. download the libssh2 package from http://libssh2.org, command as following:
    tar vxzf libssh2-1.4.2.tar.gz
    cd libssh2-1.4.2
    ./configure
    make
    make install
  2. download the php-ssh2 package from http://pecl.php.net/package/ssh2:
    tar vxzf ssh2-0.11.3
    cd ssh2-0.11.3
    phpize
    ./configure --with-ssh2
    make
    make install

    and the ssh2.so file will copy into /usr/lib64/php/modules
    check it.
  3. modify the php.ini

    vi /etc/php.ini

    add the "extension=ssh2.so" to the extension part of php.ini
  4. check the environment of php, use phpinfo();
  5. enjoy

主要兩個套件
但相依很多,缺什麼裝什麼,所以實際上是倒過來裝
遇一個殺一個了... 要有耐心... 套件就到rpmfind上找
  • libssh
    1. libssh2-1.4.2-1.el6.i686.rpm
    2. libgcrypt-1.4.5-9.el6_2.2.i686
    3. gcc-c++-4.4.7-3.el6.x86_64.rpm
    4. libstdc++-devel-4.4.7-3.el6.i686.rpm
  • ssh2
    1. ssh2-0.12.tgz
    2. php-devel-5.1.6-39.el5_8.i386.rpm
      下phpize需要

心得...
有yum好幸福,沒yum好痛苦...(還按韻ㄝ)
光一堆dependency就快放棄了...
還要找版本相融的rpm來裝...
只能靠deadline來逼自己一步步下去
不過套件找齊後,一步步裝回去還挺有成就感的...

沒有留言: