Install php extension ssh2 in linux

Source: Internet
Author: User
Tags install openssl

To use SSH in PHP, it seems that most of the materials on the Internet are copied in a version. I finally think there are two blogs that are well described, both of which are in English, one of them is the original English version, which is widely used, but it is difficult to install it, and then it was re-installed again. I don't know if it is because the occasional system is centos. Sort by yourself first:

1. Install OpenSSL
A. # Yum install OpenSSL
B. # Yum install OpenSSL-devel

2. Install libssh2:
A. # cd/usr/src
B. # wget http://www.libssh2.org/download/libssh2-1.2.8.tar.gz

C. # tar-zxvf libssh2-1.1.tar.gz
D. # cd libssh2-1.1
E. #./configure
F. # Make all install

3. Link libssh & PHP together, using PECL:
A. # PECL install-F SSH2
B. Make sure that the generated ssh2.so is in the extension directory specified by PHP. ini.
C. Modify PHP. ini and add extension = ssh2.so.

4. Compiling libssh2 PHP extension (instead of step 1 above, it seems that the above version is unstable)
A. # wget http://pecl.php.net/get/ssh2-0.11.0.tgz
B. # tar-zxvf ssh2-0.11.0.tgz
C. # cd ssh2-0.11.0
D. # phpize &./configure-with-ssh2 & make

E. # cp./modules/ssh2.so/usr/lib/php/modules/ssh2.so
F. Modify php. ini and add extension = ssh2.so.

5. restart httpd: service httpd restart

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.