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: