Logo
  • Entries
  • Comments
  • Popular
Recent Posts
  • January 2012
  • November 2011
  • October 2011
  • September 2011
  • August 2011
  • July 2011
  • June 2011
  • May 2011
  • April 2011
  • March 2011
  • February 2011
  • January 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010
  • August 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • August 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • July 2007
Recent Comments
  • Makendra It's always a pleasure to hear from someone with eexrpitse....
  • Rubén Ortiz Hola dependerá de varias cosas pero la respuesta sería NO. ...
  • jose miguel perea Buenos días, ¿La replicación entre maestro y esclavo es i...
  • Rubén Ortiz Si lo hacéis legal, con VMware el único problema son los cos...
  • Angel Hola, estamos valorando implementar baremetal para crear un ...
Popular Articles
  • Declaro la guerra al mosquito Tigre (35)
  • Phpbb3 - encode error converter (19)
  • MySQL - Variables básicas a configurar (17)
  • Reinicio programado Windows 2003 Server (16)
  • Plesk - Evitar el SPAM (10)
  • Home
  • Contacta
  • Hosting Linux
  • Legal
  • Sobre mí – About me

CentOS 5 – PHP SSH2

Posted by Rubén Ortiz on Jun 22, 2010 in Centos, Linux | 3 comments

PHP-logo

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 &amp;&amp; ./configure –with-ssh2 &amp;&amp; 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 &lt; 200412301450

y editala así:

1
#if LIBSSH2_VERSION_NUM &lt; 0x001000

Salva el archivo y vuelve a ejecutar:

1
<strong>phpize &amp;&amp; ./configure --with-ssh2 &amp;&amp; make</strong>

Links

  • http://hostechs.com/2008/07/installing-ssh2-for-php-shell-connections-how-to/comment-page-1/#comment-59
  • http://stackoverflow.com/questions/561024/install-pecl-ssh2-extension-for-php
  • http://forums.vpslink.com/centos/1682-installing-php-ssh2.html
  • http://kevin.vanzonneveld.net/techblog/article/make_ssh_connections_with_php/

3 Responses to “CentOS 5 – PHP SSH2”

  1. Sadam says:
    3 de March, 2011 at 4:03 am

    Hola, te quería agradecer. Me funciono perfecto.

  2. Benit Raul says:
    16 de March, 2011 at 1:20 am

    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,

  3. Rubén Ortiz says:
    16 de March, 2011 at 11:22 am

    “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

Leave a Reply

Click here to cancel reply.

Nube de Tags

apache bare metal benchmark cacti centos dell drupal esxi General gripe A Hardware humor IIS kayako Linux lpi lyric Lyrics memcached mysql nginx openfiler OpenVZ openx Parallels php Phpbb plesk postgresql proftpd raid SQL Server ssh svn trac ubuntu varnish Virtualizacion Virtuozzo Virtuozzo Linux Warphammer.net Windows windows 2003 wordpress zabbix

Categorias

  • 2003 Server
  • Apache 2.X
  • benchmark
  • Centos
  • Cuanto (Luser) Cabron
  • ESXi
  • General
  • Hardware
  • IIS
  • Lighttpd
  • Linux
  • Lyrics
  • MySql
  • Nginx
  • OpenVZ
  • Parallels
  • Parallels Bare Metal
  • Php
  • Phpbb
  • Plesk
  • PostgreSQL
  • Prestashop
  • Software
  • SQL SERVER
  • Ubuntu
  • Varnish
  • Virtualizacion
  • Virtuozzo
  • Virtuozzo Windows
  • VMWare
  • Warphammer.net
  • Windows
  • Wordpress

Blogroll

  • David Toribio
  • EasyCompany.es
  • Marius Duch
  • Series
  • Warphammer.net

Recursos

  • Backup Plesk9
  • CentOS 5 32 bits RPMs
  • CentOS 5 64 bits RPMs
  • Lighttpd
  • MySQL Tunner
  • OpenVZ – Panel – PROXMOX
  • OpenVZ – Panel – VTONF
  • OpenVZ Wiki
  • Parallels Virtual Automation Resources
  • Plesk 8 Docs
  • Plesk 9 Docs
  • Plesk Hacker
  • Port80 – Compression Check
  • Virtuozzo DOCS
  • Virtuozzo Lin Commands
  • Virtuozzo Win Commands
  • Virtuozzo Windows Docu

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org
Designed by Elegant Themes | Powered by Wordpress