Project

General

Profile

Actions

Install SSH module for PHP » History » Revision 11

« Previous | Revision 11/31 (diff) | Next »
Neil Voss, 05/27/2010 03:40 PM


Install SSH module for PHP

This installation occurs on the web server.

The ssh2 extension for php

Name: Download site: CentOS yum package name Fedora yum package name SuSE rpm name
re2c http://re2c.org/ re2c re2c
php devel http://pear.php.net/ php-devel php-devel
libssh2 devel http://pear.php.net/ libssh2-devel libssh2-devel
SSH PECL extension http://www.php.net/manual/en/ssh2.installation.php php-pear php-pear

For newer systems the extension is available through the repository, e.g., on Fedora 12 type "sudo yum install php-pecl-ssh2"

Download and compile the ssh2 extension

See http://www.php.net/manual/en/ssh2.installation.php for more information

  1. Go the website http://pecl.php.net/package/ssh2
  2. Download the latest version of ssh2:
    wget http://pecl.php.net/get/ssh2-0.11.0.tgz
  3. Extract the tar ball
    tar zxvf ssh2-0.11.0.tgz
  4. Go into the directory
    cd ssh2-0.11.0
  5. Run phpize and standard make process
    phpize
    ./configure
    make
  6. Install the module:
    sudo make install
  7. Add a ssh2.ini to your php ini folder:
    sudo touch /etc/php.d/ssh2.ini
    sudo chmod 666 /etc/php.d/ssh2.ini
    echo "; Enable mrc extension module" > /etc/php.d/ssh2.ini
    echo "extension=mrc.so" >> /etc/php.d/ssh2.ini
    sudo chmod 444 /etc/php.d/ssh2.ini
    cat /etc/php.d/ssh2.ini
    
  8. Restart httpd:
    sudo /sbin/service httpd restart

The extension module is added to php in the same way as does the php-mrc module we distribute for the viewing mrc images through php. To check whether it worked and for alternative way to make php recognize the module used in newer php, see http://emg.nysbc.org/documentation/leginon/bk02ch04s07.php under the section Check php information and Alternative approach if mrc module does not show up in info.php output
_

< Setup job submission server | Configure web server to submit jobs >


Updated by Neil Voss over 14 years ago · 11 revisions