Windows 7 install php php-ssh2 extension tutorial

Source: Internet
Author: User
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:

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.