Install SSH module for PHP » History » Version 29
  Amber Herold, 05/07/2012 10:48 AM 
  
| 1 | 1 | Neil Voss | h1. Install SSH module for PHP | 
|---|---|---|---|
| 2 | |||
| 3 | 28 | Amber Herold | {{include(Install_SSH_module_for_PHP_shared)}} | 
| 4 | |||
| 5 | 10 | Neil Voss | This installation occurs on the web server. | 
| 6 | |||
| 7 | 3 | Neil Voss | h2. The ssh2 extension for php | 
| 8 | 1 | Neil Voss | |
| 9 | 21 | Amber Herold | First, install the following prerequisites: | 
| 10 | |||
| 11 | 7 | Neil Voss | |_.Name:|_.Download site:|_.CentOS yum package name|_.Fedora yum package name|_.SuSE rpm name| | 
| 12 | 18 | Neil Voss | |php devel |http://www.php.net |php-devel |php-devel| | | 
| 13 | 24 | Amber Herold | |libssh2 devel |http://www.libssh2.org |libssh2-devel (found in epel repo)|libssh2-devel| | | 
| 14 | 15 | Neil Voss | |SSH PECL extension |http://www.php.net/manual/en/ssh2.installation.php |- |php-pecl-ssh2 | | | 
| 15 | 1 | Neil Voss | |
| 16 | bq. For newer systems the extension is available through the repository, e.g., on Fedora 12 type "@sudo yum install php-pecl-ssh2@" | ||
| 17 | |||
| 18 | 8 | Neil Voss | h2. Download and compile the ssh2 extension | 
| 19 | 3 | Neil Voss | |
| 20 | 13 | Neil Voss | bq. This setup is almost identical to the [[Install the MRC PHP Extension]]. See http://www.php.net/manual/en/ssh2.installation.php for more information. | 
| 21 | 9 | Neil Voss | |
| 22 | 4 | Neil Voss | # Go the website http://pecl.php.net/package/ssh2 | 
| 23 | # Download the latest version of ssh2:<pre> | ||
| 24 | 26 | Neil Voss | wget http://pecl.php.net/get/ssh2-0.11.2.tgz</pre> | 
| 25 | 4 | Neil Voss | # Extract the tar ball<pre> | 
| 26 | 27 | Neil Voss | tar zxvf ssh2-0.11.2.tgz</pre> | 
| 27 | 5 | Neil Voss | # Go into the directory<pre> | 
| 28 | 27 | Neil Voss | cd ssh2-0.11.2</pre> | 
| 29 | 6 | Neil Voss | # Run phpize and standard make process<pre> | 
| 30 | phpize | ||
| 31 | ./configure | ||
| 32 | 1 | Neil Voss | make</pre> | 
| 33 | 10 | Neil Voss | # Install the module:<pre> | 
| 34 | 1 | Neil Voss | sudo make install</pre> | 
| 35 | 11 | Neil Voss | # Add a ssh2.ini to your php ini folder:<pre> | 
| 36 | sudo touch /etc/php.d/ssh2.ini | ||
| 37 | sudo chmod 666 /etc/php.d/ssh2.ini | ||
| 38 | 12 | Neil Voss | echo "; Enable ssh2 extension module" > /etc/php.d/ssh2.ini | 
| 39 | echo "extension=ssh2.so" >> /etc/php.d/ssh2.ini | ||
| 40 | 11 | Neil Voss | sudo chmod 444 /etc/php.d/ssh2.ini | 
| 41 | cat /etc/php.d/ssh2.ini | ||
| 42 | </pre> | ||
| 43 | 10 | Neil Voss | # Restart httpd:<pre> | 
| 44 | sudo /sbin/service httpd restart</pre> | ||
| 45 | 1 | Neil Voss | |
| 46 | 13 | Neil Voss | h2. Test if the module is working: | 
| 47 | |||
| 48 | # go to the info.php that was created earlier in the [[Install the MRC PHP Extension]], http://localhost/info.php or http://HOST.INSTITUTE.EDU/info.php | ||
| 49 | # search for the ssh2 module, you should see this section: | ||
| 50 | |||
| 51 | 14 | Neil Voss | !ssh2box.png! | 
| 52 | 22 | Amber Herold | |
| 53 | 25 | Neil Voss | h2. Still having problems? | 
| 54 | |||
| 55 | # on one machine restarting httpd was not enough, I had to restart the entire system to get it working (even though it shows up under info.php) | ||
| 56 | |||
| 57 | 1 | Neil Voss | _______ | 
| 58 | 22 | Amber Herold | |
| 59 | 1 | Neil Voss | |
| 60 | 20 | Amber Herold | [[Setup job submission server|< Setup job submission server]] | [[Configure_web_server_to_submit_job_to_local_cluster|Configure web server to submit job to local cluster >]] | 
| 61 | 1 | Neil Voss | |
| 62 | _______ |