Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I use phing as a deployment tool on CentOS and I'd like to use the SshTask, which required libssh2 to be installed.

I tried "pecl install ssh2" but that asks me for a libssh2 prefix [/usr?]

I noticed that this means I need to install libssh2 first, but yum does not have that package. So my question is: what is the best way to install libssh2 on Centos and then install the pecl extension?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

to install libssh2 on centos follow the next steps:

  1. download libssh2 from the official website (look for in google - i don't have reputation and can't post but 1 link)

  2. extract it somewhere, then open a terminal and go in the folder where you extracted it and type these commands

    ./configure
    
    
    make
    
    
    make install
    

ALSO

you can install the rpmforge repos from DAG from here:

http://dag.wieers.com/rpm/packages/rpmforge-release/

(check your version, if you're on i386 you'll probably have to get the "Red Hat EL 5 - i386" one)

then do a

yum install libssh2
share|improve this answer
    
thanks, perfect info. Now when I'm installing "pecl install ssh2" it asks "libssh2 prefix? [/usr]". Is that ok, or should it be "/usr/lib/libssh2.so.1"? [user@centos deployment]# rpm -ql libssh2 /usr/lib/libssh2.so.1 –  solsol Jun 2 '10 at 21:48
    
no matter what I type there, it says: configure: error: The required libssh2 library was not found. You can obtain that package from sourceforge.net/projects/libssh2 ERROR: `/tmp/pear/download/ssh2-0.11.0/configure --with-ssh2=/usr/lib/libssh2.so.1' failed –  solsol Jun 2 '10 at 21:49
    
solved: it needed this: yum install libssh2-devel –  solsol Jun 2 '10 at 21:56
    
except for new errors: running: make /tmp/pear/download/ssh2-0.11.0/ssh2.c:1104: warning: passing argument 4 of 'add_assoc_stringl_ex' discards qualifiers from pointer target type /tmp/pear/download/ssh2-0.11.0/ssh2.c:1105: warning: passing argument 4 of 'add_assoc_stringl_ex' discards qualifiers from pointer target type make: *** [ssh2.lo] Error 1 ERROR: `make' failed –  solsol Jun 2 '10 at 21:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.