Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

SSH2 Extension for PHP-FPM

nimdynimdy Member
edited February 2012 in Help

Hi all,

Does anyone know how I can get the SSH2 extension working with PHP-FPM (LEMP)? I've googled it but can only find people asking the question with little or no answers. I'm trying to get Ajaxplorer working on my VPS.

Thanks.

Comments

  • @nimdy - What distro are you running? On deb-based, all you need is:

    install libssh2-1-dev libssh2-php
    php -m |grep ssh2
    

    The second command will return ssh2 if it's installed successfully.

  • Debian. Thanks that worked a treat. I thought it was a conf file change or file download that I was looking for, not a simple apt-get :)

    Thanks.

  • No worries :P

    Just keep in mind that php ssh2 is a bit of a pain if you're going to use RSA. Try as I might, I could not get any RSA key with a passphrase to authenticate. RSA keys with a blank passphrase worked just fine, however.

    If you're wanting to use a key, go with DSA. So far that's worked like a champ for me.

  • Its probably better todo it via "pecl install ssh2-beta", it automatically puts the extension file in the right place.

    I also made a tutorial on installing it in a few minutes under CentOS, its a similar process for Debian, but using apt-get and the same packages (different names however).

    http://www.landofdaniel.com/blog/2011/05/31/installing-php-ssh2-under-centos-yum/

  • @Daniel - have you ever run into the RSA problem I described above?

  • MrAndroidMrAndroid Member
    edited February 2012

    @Aldryic said: @Daniel - have you ever run into the RSA problem I described above?

    PHP-SSH2 is an absolute nightmare for RSA, the extension itself has not been updated for a while and has quite a lot of bugs.

    A library was created to solve this, using a pure PHP implementation for SSH2 connections, I tried using it, but compared to the extension, its fairly hard to use.

    http://phpseclib.sourceforge.net/

    http://phpseclib.sourceforge.net/documentation/net.html#net_ssh_ssh2

  • Aaah, lovely. I'll look into that when I have some free time, thanks for the info.

  • MrAndroidMrAndroid Member
    edited February 2012

    @Aldryic said: Aaah, lovely. I'll look into that when I have some free time, thanks for the info.

    No problem. My Software (PiePanel), takes advantage of the SSH2 module, although some changes in order to speed it up.

  • @Daniel - what makes phpseclib hard to use? I found it's OOP API easier to use than PHP-SSH2's API.

    How would you do the API out of curiosity?

Sign In or Register to comment.