2

I install ssh2 on my server but when i check the result is :

PHP Warning: PHP Startup: ssh2: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20090626
These options need to match in Unknown on line 0

I uses centos 6 and directadmin

neubert
  • 15,947
  • 24
  • 120
  • 212
adi wijaya
  • 31
  • 1
  • 2
  • 1
    The error message means that you did install the wrong version of the SSH2 extension. You need to remove it again and install a version that matches with your PHP version. If you need further guidance, you need to show which PHP package you use extactly. See the the documentation of your package manager (most likely `yum`) to find out how you can find out which PHP package you've got installed and which SSH2 PHP extension package you've got installed. Add the information (both the command to find out as well as the output) to your question by editing it. – hakre Aug 31 '13 at 08:27
  • can you show the steps you have done? if you try the way described here: http://de1.php.net/manual/en/ssh2.installation.php#109853 .. does it work? – hek2mgl Aug 31 '13 at 08:29
  • do you have root ssh access to the box? – hek2mgl Aug 31 '13 at 08:53
  • Hi all thanks for answer, I ever try that link but still same. Yes, I've root access. I try this too : http://forum.directadmin.com/showthread.php?t=30682&p=242694#post242694 and http://forum.directadmin.com/showthread.php?t=44633 etc. the result still same. my php version is 5.3.27 and I've try ssh2-12.0 and ssh2-11.30 . the result is same. when I try ssh2-11.0 the result is make *** [error] cannot make ssh2.so I try rebuild php from custombuild directadmin and install shh2 again but error still same. Please help me. – adi wijaya Aug 31 '13 at 11:00

2 Answers2

2

libssh2 is notoriously difficult to install. Personally, I would recommend you try phpseclib, a pure PHP SSH2 implementation.

neubert
  • 15,947
  • 24
  • 120
  • 212
0

You could try to install ssh2 through yum, enabling remi.repo if required:

$ sudo yum install php-pecl-ssh2

It will install php-pecl-ssh2 package of the same version as your PHP is.

But it also possible to install it through pecl if you have any reasons to do it:

  1. # yum install php-devel

  2. # pecl channel-update pecl.php.net

  3. # pecl install ssh2

Tested for Oracle Linux 7.

Gryu
  • 2,102
  • 2
  • 16
  • 29