Skip to content

Install ssh2, libpssh and pssh extension

Ilyas Salikhov edited this page Feb 11, 2014 · 5 revisions

Instructions for CentOS/RedHat. All commands require root rights.

Installation libssh2

libpssh requires patched by Badoo version of libssh2.

yum install libtoolize
cd /usr/local/src
git clone https://github.com/badoo/libssh2
cd libssh2/
./buildconf
./configure
make
make install

Installation libpssh

libpssh requires libevent version 2 or higher.

Check version of libevent:

yum list installed | grep libevent

Installation of libevent:

cd /usr/local/src/
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar xfz libevent-2.0.21-stable.tar.gz 
cd libevent-2.0.21-stable
./configure 
make
make install

Installation of libpssh:

cd /usr/local/src/
git clone https://github.com/badoo/libpssh
cd libpssh/
./autogen.sh
./configure --with-event=/usr/local
make
make install

Installation pssh_extension

git clone https://github.com/badoo/pssh_extension
cd pssh_extension/
phpize
./configure
make
make install

Include extension in PHP. Add

cat > /etc/php.d/pssh.ini

values

extension=pssh.so

Check extension including:

$ php -v
PHP 5.5.5 (cli) (built: Oct 27 2013 13:14:07) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
    with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies

Troubleshooting

You can get message if you include php extensions pssh and curl simultaneously:

$ php -v
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pssh.so' - /usr/local/lib/libpssh.so.1: undefined symbol: libssh2_session_last_io in Unknown on line 0
PHP 5.5.5 (cli) (built: Oct 27 2013 13:14:07) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
    with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies

Extension curl include standard libssh2 before pssh which uses patched libssh2. Solution described here. Simple way is deleting of curl extension. If you need curl you can rebuild libcurl without ssh support.

Clone this wiki locally