PHP & SSH

From CodeMonkeyWiki

Jump to: navigation, search
yum install libssh2 libssh2-devel openssl openssl-devel
wget http://pecl.php.net/get/ssh2-0.10.tgz
tar zxvf ssh2-0.10.tgz
cd ssh2-0.10
phpize
./configure --with-ssh2


now edit ssh2.c:

on line 480, change:

#if LIBSSH2_APINO < 200412301450

to:

#if (defined(LIBSSH2_APINO) && LIBSSH2_APINO < 200412301450)

on line 1216, change:

#if (LIBSSH2_APINO > 200503221619)

to:

#if (defined(LIBSSH2_APINO) && (LIBSSH2_APINO > 200503221619)) || (defined(LIBSSH2_VERSION_NUM) && LIBSSH2_VERSION_NUM >= 0x001000)
make
cd modules
mv ssh2.so /usr/local/apache2/modules

now edit php.ini (typically in /usr/local/lib if built from source) and add the following line under the section "Dynamic Extension"

extension=/usr/local/apache2/modules/ssh2.so
/usr/local/apache2/bin/apachectl restart
Personal tools