Module Installation php libssh2 on CentOS 6.x

Sunday, 08 February 2015 16:32

Today, faced with the problem of installing php module libssh2 on a server with Centos 6.6 and PHP 5.4.37.

A simple way, like team pecl install ssh2, the module becomes refused flies error "Failed to download pecl/ssh2 within preferred state "stable", latest release is version 0.12, stability "beta", use "channel://pecl.php.net/ssh2-0.12" to install install failed".

To deal with this, I did not, and went the other way.

So, first install the necessary packages:

yum install gcc php-devel php-pear openssl openssl-devel httpd-devel make

 Now install extensions libssh2, the latest version of which can be found at libssh2.org. At the moment it libssh2-1.4.3.

wget http://libssh2.org/download/libssh2-1.4.3.tar.gz
tar vxzf libssh2-1.4.3.tar.gz
cd libssh2-1.4.3
./configure
make
make install

Next, put the package php-ssh2, which take away from the page http://pecl.php.net/package/ssh2. The latest version is now ssh2-0.12.

wget http://pecl.php.net/get/ssh2-0.12.tgz
tar vxzf ssh2-0.12.tgz
cd ssh2-0.12
phpize
./configure --with-ssh2
make
make install

Check that the folder /usr/lib64/php/modules we have a file ssh2.so.

If all is well, then create a file folder /etc/php.d ssh2.ini and enter into it:

extension=ssh2.so

Now restart the web server command:

service httpd restart

Finally check whether normally have to install the module:

php -m | grep ssh2

It works :)


/root/modulos/ssh2-0.12/ssh2.c: In function ‘zif_ssh2_auth_agent’:
/root/modulos/ssh2-0.12/ssh2.c:1154:2: error: unknown type name ‘LIBSSH2_AGENT’
LIBSSH2_AGENT *agent = NULL;
^
help D:

NA NA | Saturday, 25 July 2015 07:16


Leave a comment

  • Payment
    Methods:
  • visa
  • mastercard
  • qiwi
  • webmoney
  • yandex money
  • sberbank
  • mts bank
  • zpayment
  • liqpay
  • alfabank white
Copyright © 2012 - 2024 WebPatron Ltd. All rights reserved.