This article mainly introduces the Windows 7 installation of php php-ssh2 extension tutorial, this article also applies to XP system, but Win8 has not been tested, if you want to transfer files to the test server, you can see that PHP supports the ssh operation. so I sorted out the installation process and shared it with you.
Installation steps
1. Download php extension ssh2
Http://windows.php.net/downloads/pecl/releases/ssh2/0.12/
Bytes
2. after decompression, there will be three files: libssh2.dll, php_ssh.dll, and php_ssh2.pdb.
3. put php_ssh.dll and php_ssh2.pdb in your php extension directory php/ext.
4. copy libssh2.dll to c:/windows/system32 and c:/windows/syswow64.
5. add extension = php_ssh2.dll to php. ini.
6. restart apache to use php for ssh connection.
Check whether phpinfo () is successfully loaded.
PHP test code
The code is as follows:
<? Php
$ Connection = ssh2_connect ('192. 168.20.128 ', 22 );
Ssh2_auth_password ($ connection, 'root', '123 ');
Ssh2_scp_send ($ connection, 'd:/tmp/test.txt ','/tmp/test.txt ', 0644 );
Test: