• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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