Wednesday, April 23

Installing SSH2 (Secure Shell2) Extension for PHP on Redhat/CentOS 5&6

                                                             

SSH2 is a Bindings to the libssh2 library which provide access to resources (shell, remote exec, tunneling, file transfer) on a remote machine using a secure cryptographic transport.

   where  libssh2 is a client-side C-library implementing the SSH2 protocol

Requirements :

            1. The OpenSSL and  libssh2 libraries are required.

            2. Version 1.2 or newer of the libssh2 library is required

  Before Start installation process,  install EPEL REPOSITORY .OpenSSL and  libssh2 packages are dependencies of SSH2, these packages are stored in EPEL repo.

Step 1:  Install EPEL repo

          See this link to install EPEL repository.

Step 2:   We are install the dependencies using EPEL repo

             # yum install gcc php-devel php-pear libssh2 libssh2-devel

step 3: These will allow us to build the SSH2 extension using pecl.

            # pecl install -f ssh2

 Note : After Running this command script is executed , you have to do is hit Enter and it should detect the proper path.Once the install is completed,
 you just have to tell PHP to load the extension when it boots.

Step 4: PHP to load the extension when it boots.


            # touch /etc/php.d/ssh2.ini
 
           # echo extension=ssh2.so > /etc/php.d/ssh2.ini

Step 5 : Restart the webserver and check.

             # /etc/init.d/httpd restart

             # php -m | grep ssh2

Get a line return 'ssh2'. Thats it SSH2 is successfully installed in ur Server.  
      

No comments:

Post a Comment

:: Linux - Legends ::