
Necesitaremos tres paquetes: openssl, libssh2 y ssh2
Comprobamos si tenemos openssl instalado:
1 | <strong>[root@box1 ~]#rpm -qa |grep openssl</strong> |
Si sale algo así lo tenemos ok
1 2 3 | <strong>openssl096b-0.9.6b-22.46 openssl-0.9.7a-43.17.el4_6.1 openssl-devel-0.9.7a-43.17.el4_6.1</strong> |
Las versiones difieren según la instalación. Sino lo tenemos lo instalamos:
1 | <strong>yum install openssl</strong> |
(redhat OS)
1 | <strong>apt-get install openssl</strong> |
(debian OS)
El segundo paquete es el libssh2.
1 2 3 4 5 6 7 8 9 10 | <strong>[root@box1 ~]wget http://downloads.sourceforge.net/project/libssh2/ old-libssh2-releases /1.1/libssh2-1.1.tar.gz?use_mirror=freefrhttp: //downloads.sourceforge.net/project/libssh2/old-libssh2-releases /1.1/libssh2-1.1.tar.gz?use_mirror=freefr [root@box1 ~]tar -zxvf libssh2-1.1.tar.gz [root@box1 ~]cd libssh2-1.1 [root@box1 libssh2-0.18]# ./configure [root@box1 libssh2-0.18]# make [root@box1 libssh2-0.18]# make install</strong> |
Ahora necesitamos instalar el módulo ssh para PHP
1 2 3 4 | <strong>[root@box1 ~]# wget http://pecl.php.net/get/ssh2-0.10.tgz [root@box1 ~]# tar -xzf ssh2-0.10.tgz [root@box1 ~]# cd ssh2-0.10 [root@box1 ssh2-0.10]# phpize && ./configure –with-ssh2 && make</strong> |
Si finaliza sin errores ya lo tenemos instalado, faltaría añadir la extensión en el php.ini
extension=ssh2.so
Si nos encontramos un error como este:
1 | *** [ssh2.lo] Error 1 |
Tendremos que hacer una pequeña modificación:
1 | [root@box1 ssh2-0.10]# vi ssh2.c |
Busca la linea
1 | #if LIBSSH2_APINO < 200412301450 |
y editala así:
1 | #if LIBSSH2_VERSION_NUM < 0x001000 |
Salva el archivo y vuelve a ejecutar:
1 | <strong>phpize && ./configure --with-ssh2 && make</strong> |
Links
Hola, te quería agradecer. Me funciono perfecto.
Hola, a mi me da este problema cuando ejecuto “./configure”
—-
checking for shared library run path origin… done
checking for libssl… no
checking for libgcrypt… no
configure: error: cannot find OpenSSL or Libgcrypt,
try –with-libssl-prefix=PATH or –with-libgcrypt-prefix=PATH
—-
Lo curioso es que si que lo tengo instalado:
openssl-0.9.8e-12.el5_5.7
¿Sabes a que pudiera deberse?
Saludos,
“configure: error: cannot find OpenSSL” supongo que te falta algún paquete relativo a este software. Intenta un “yum install openssl-devel” o similar.
Saludos