To install the wrapper on Ubuntu, please find the steps below:
1. Install apache and PHP first
sudo apt-get install apache2 php5 libapache2-mod-php5sudo /etc/init.d/apache2 restart
2. Make sure that the server/computer have a fully qualified domain name (FQDN). Otherwise, apache2 may not be able to start.
sudo vi /etc/hostssudo vi /etc/hostname
3. Install the library for ssh wrapper
sudo apt-get install libssh2-1-dev libssh2-php
4. Confirm that ssh has been installed correctly
php -m | grep ssh2
You are expecting to see "ssh2"
5. Finish
Now you can start to write PHP script to connect to an SSH server
No comments:
Post a Comment