Work notes for installing PHP SSH2 extension in CentOS environment

Source: Internet
Author: User
Tags install php ini php file ssh centos
Because you need to debug the php file that can execute files in the current Linux server environment and need to run the SSH process remotely, P always tells us that you need to deploy the SSH2 extension in the current server environment to compile the SSH script command in the PHP file. Therefore, the old left installs the SSH2 extension in the current CentOS environment, which is recorded as follows, for later reference if necessary.

 

Note: If you need to run the tool directly in the formal environment, we recommend that you debug the tool before using the tool or back up the data to avoid possible problems.

 

1. Install the support library file

 

The code is as follows: Copy code

Yum install php-devel php-pear libssh2 libssh2-devel-y

 

Log on to the SSH client directly, and run the command "enter" to install the required library file.

 

2. Install the SSH2 extension

 

The code is as follows: Copy code

Pecl install-f ssh2

 

Run the command, and then you can see an input interface. Press Enter.

 

 

Press enter to automatically install the SDK.

 

 

3. Modify ssh2.ini

 

The code is as follows: Copy code

Touch/etc/php. d/ssh2.ini

Echo extension = ssh2.so>/etc/php. d/ssh2.ini

 

Add the file.

 

4. Check whether SSH2 is successfully installed.

 

The code is as follows: Copy code

Php-m | grep ssh2

Php-I | grep ssh2

 

 

Here, we can see that the SSH2 extension installed on the left is complete and successful.

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.