2

I use php 5.5.3 on a Ubuntu 13.10 server and want to use ssh2 with php. So I installed libssh2-php with this command: apt-get install libssh2-php

Installation runs without error. I got a ssh2.ini file within /etc/php/conf.d. Restarted apache2 even rebooted the server but php -m | grep ssh2 didn't return anything. phpinfo() got also no ssh entries :(

What is missing?

2 Answers 2

2

I found the solution. It's the same problem like mcrypt described here: https://askubuntu.com/questions/362082/php-is-not-working-well-on-ubuntu-13-10-and-mcrypt-is-missing-in-phpmyadmin

to get ssh2 running you have to move the ssh2.ini from /etc/php/conf.d/ssh2.ini to /ect/php/mods-available/ Then run php5enmod ssh2 and restart apache2

0

correct installation for enabling SSH2 in PHP is below for PHP7.4 and on word

sudo apt-get install php7.4-ssh2

this command will eject /etc/php/7.4/mods-available/ssh2.ini in given PHP as shown below

sudo service apache2 restart 

OR

sudo systemctl restart apache2

verification

more /etc/php/7.4/mods-available/ssh2.ini
extension=ssh2.so
php -m | grep ssh
ssh2

Now all is ok and working ssh2 is PHP and apache2 you can also verify it from apache/PHP code in web create file info.php in /var/www/html/

vi /var/www/html/info.php`

add following lines in above file

<?php
phpinfo();
?>

then search code in web page ssh2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .