• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

PHP-SSH2 Problem

TimeBandit

New Pleskian
Hello all!

I've tried to install the php-ssh2 extension, but actually that seems to be impossible for me..
php-ssh2 is installed correct, but Apache won't load the module due to the following error:

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

Any suggestions?
 
You can use following instruction for installation php ssh2 extension for PHP5.4, for example:

1. Install all necessary packages for compiling ssh2 module:

# yum install make plesk-php54-devel gcc glibc-devel libssh2-devel zlib-devel

2. Compile ssh2 module:

# /opt/plesk/php/5.4/bin/pecl install ssh2 channel://pecl.php.net/ssh2-0.12

3. Add extension to corresponding ini file:

# echo "extension=ssh2.so" > /opt/plesk/php/5.4/etc/php.d/ssh2.ini

4. Reread php handlers:

# plesk bin php_handler --reread

5. Go to Tools&Settings -> PHP Settings -> 5.4.xxxx

6. Enjoy the view of the installed ssh2 module.
 
Can i use this instruction for installation with php 5.5 or 5.6 ?
Works the php ssh2 extension in php5.5 an 5.6 ?
 
Can i use this instruction for installation with php 5.5 or 5.6 ?
Works the php ssh2 extension in php5.5 an 5.6 ?
Yes, just use following changes for php5.6, for example:

# yum install make plesk-php56-devel gcc glibc-devel libssh2-devel zlib-devel
# /opt/plesk/php/5.6/bin/pecl install ssh2 channel://pecl.php.net/ssh2-0.12
# echo "extension=ssh2.so" > /opt/plesk/php/5.6/etc/php.d/ssh2.ini
.....
 
Yes, just use following changes for php5.6, for example:

# yum install make plesk-php56-devel gcc glibc-devel libssh2-devel zlib-devel
# /opt/plesk/php/5.6/bin/pecl install ssh2 channel://pecl.php.net/ssh2-0.12
# echo "extension=ssh2.so" > /opt/plesk/php/5.6/etc/php.d/ssh2.ini
.....

Hello IgorG, thank you for this solution. I have been looking all over the internet for it. So I had the same problem as the original post, however, I have Plesk installed on Ubuntu. I've trying for more than 10 hours straight to fix the issue with no luck. Now I reinstalled Plesk in order to get the server back and running. I want to install the extension, but I'm afraid that it will screw up all my server again. What should I modify for this code to work on my Ubuntu server?

Thank you very much.
 
What should I modify for this code to work on my Ubuntu server?
Just replace installation necessary packages for CentOS

# yum install make plesk-php56-devel gcc glibc-devel libssh2-devel zlib-devel

to corresponding command and package names for Ubuntu. Something like

# apt-get install plesk-php56-devel....
 
Just replace installation necessary packages for CentOS

# yum install make plesk-php56-devel gcc glibc-devel libssh2-devel zlib-devel

to corresponding command and package names for Ubuntu. Something like

# apt-get install plesk-php56-devel....

Thanks, I did that and I got the following:

E: Unable to locate package plesk-php56-devel

E: Unable to locate package glibc-devel

E: Unable to locate package libssh2-devel

E: Unable to locate package zlib-devel

I ran apt-get update but it did not help... :(
 
Because names of the same packages for CentOS and Ubuntu are different. Please try to find appropriate package names for Ubuntu by yourself. Unfortunately, at the moment I have no Debian/Ubuntu test environment.
 
Hi Hamza Jazmati,

for Ubuntu/Debian - based systems, you have the choice to use

apt-cache search plesk | grep php

which will search for all available and possible plesk-php - packages. Just a small hint: ALL "devel" - packages are named with "-dev" instead of "-devel" :p
 
Back
Top