Join the community today
Register Now

PHP-FPM Install PHP extension ssh2

Discussion in 'Centmin Mod Insights' started by Steve Tozer, Jul 30, 2014.

  1. Oxide

    Oxide Active Member

    515
    29
    28
    Mar 19, 2015
    Ratings:
    +54
    Local Time:
    11:00 PM
  2. eva2000

    eva2000 Administrator Staff Member

    38,527
    8,492
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,055
    Local Time:
    11:00 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    ssh2 php extension for php 7 works with php versions <7
     
  3. SneakyDave

    SneakyDave Member

    82
    14
    8
    Jul 24, 2014
    Ratings:
    +22
    Local Time:
    8:00 AM
    1.0.15
    Figured this out on my own (yay). The ssh2-0.12 directory in /srv-setup was old or something, it had an older version of ssh2.so in it (with the 2010-05-25 date), so I blew that away, and rebuilt it from instuctions in the first post.

    Please delete or move if you wish. Thanks.

    Back to this topic of installing ssh2, I've done the steps in the first post, and now I'm getting this error. I assume I have 2 versions of ssh2 somewhere, or references to the library somewhere, but where could I find them?

    I only have 1 reference to ssh2.so in /etc/centminmod/php.d, no other references to ssh2.so in that php directory (PHP 5.5.30).

    There is no module named ssh2.so in the /usr/local/lib/php/extensions/no-debug-non-zts-20100525, which is where I think it is finding one(?).

    But I did find a ssh2.so dated 2010-05-25 in:
    /svr-setup/ssh2-0.12/.libs/ssh2.so

    I have a feeling that I've missed something simple.


    Code:
    [[email protected] php.d]# php --ri ssh2
    PHP Warning:  PHP Startup: ssh2: Unable to initialize module
    Module compiled with module API=20100525
    PHP    compiled with module API=20121212
    These options need to match
    in Unknown on line 0
    Extension 'ssh2' not present.
    [[email protected] php.d]#
    
    
    Code:
    [[email protected]]# phpize -v
    Configuring for:
    PHP Api Version:         20121113
    Zend Module Api No:      20121212
    Zend Extension Api No:   220121212
    
     
    Last edited: Dec 29, 2015
  4. eva2000

    eva2000 Administrator Staff Member

    38,527
    8,492
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,055
    Local Time:
    11:00 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
  5. eva2000

    eva2000 Administrator Staff Member

    38,527
    8,492
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,055
    Local Time:
    11:00 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    FYI, seems there's a separate ssh2 PHP 7 branch at Sean-Der/pecl-networking-ssh2 at php7 ยท GitHub

    so ssh2.sh script for it would be

    save contents into ssh2.sh
    Code:
    #!/bin/bash
    cd /svr-setup
    #wget http://pecl.php.net/get/ssh2-0.12.tgz
    #tar xvzf ssh2-0.12.tgz
    #cd ssh2-0.12
    git clone -b php7 https://github.com/Sean-Der/pecl-networking-ssh2.git ssh2-php7
    cd ssh2-php7
    make clean
    git stash
    git pull
    phpize
    ./configure --with-ssh2 --with-php-config=/usr/local/bin/php-config
    make
    make install
    
    CONFIGSCANDIR='/etc/centminmod/php.d'
    touch ${CONFIGSCANDIR}/ssh2.ini
    echo "extension=ssh2.so" > ${CONFIGSCANDIR}/ssh2.ini
    service php-fpm restart
    
    To run the ssh2.sh script
    Code:
    chmod +x ssh2.sh
    ./ssh2.sh
    Code:
    php --ri ssh2
    
    ssh2
    
    SSH2 support => enabled
    extension version => 0.12+dev
    libssh2 version => 1.4.2
    banner => SSH-2.0-libssh2_1.4.2
     
  6. Sunka

    Sunka Well-Known Member

    1,097
    297
    83
    Oct 31, 2015
    Rijeka, Croatia
    Ratings:
    +478
    Local Time:
    2:00 PM
    Nginx 1.15.8
    MariaDB 10.3.12
  7. eva2000

    eva2000 Administrator Staff Member

    38,527
    8,492
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,055
    Local Time:
    11:00 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    looks like ssh2 php extension doesn't support PHP 7.3 yet
     
  8. eva2000

    eva2000 Administrator Staff Member

    38,527
    8,492
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,055
    Local Time:
    11:00 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
  9. Sunka

    Sunka Well-Known Member

    1,097
    297
    83
    Oct 31, 2015
    Rijeka, Croatia
    Ratings:
    +478
    Local Time:
    2:00 PM
    Nginx 1.15.8
    MariaDB 10.3.12
    I will wait, because ssh2 is not "to must" for now to me
     
    • Like Like x 1
..