in the Linux Server The SSH2 extension is deployed in the environment to compile the SSH script commands in the PHP file , and is configured as follows, if it is run directly in a formal environment, It is recommended that you do a backup.
1. Installing the supported library files
command:yum install php-devel php-pear libssh2 libssh2-devel
2. build ssh2 Extensions
command:pecl install-f SSH2
After that, the installed log will be displayed, and you will need to press ENTER directly when selecting.
3. after the installation is successful, you need to modify Ssh2.ini
[Email protected] etc]# Touch/etc/php.d/ssh2.ini
[Email protected] etc]# echo extension=ssh2.so >/etc/php.d/ssh2.ini
you can open /etc/php.d/ssh2.ini with vim to confirm that it already contains extension=ssh2.so
4. Verify that the installation is successful
php-m | grep SSH2
Display ssh2 indicates successful installation
Installing SSH2 extensions in Linux systems detailed Linux skills learning