Windows7 to install PHP under the Php-ssh2 extended Tutorial _php instance

Source: Internet
Author: User
Tags install php

Because want to do a test server to send file requirements, see PHP support SSH operation, so sorted out the installation process, and share with you.

Installation steps

1. Download PHP extension SSH2
Download Address http://windows.php.net/downloads/pecl/releases/ssh2/0.12/

According to their version of PHP to download, I use thread-safe, so download is Php_ssh2-0.12-5.4-ts-vc9-x86.zip

2. After the decompression, there will be three files, Libssh2.dll, Php_ssh.dll, php_ssh2.pdb.

3. Place Php_ssh.dll and php_ssh2.pdb under php/ext/under your PHP extensions directory.

4. Copy Libssh2.dll to C:/windows/system32 and c:/windows/syswow64

5. Join Extension=php_ssh2.dll in PHP.ini

6. Restart Apache, you can use PHP to perform an SSH connection operation.

View Phpinfo (), whether there is a display PHP_SSH2 extended load success.

PHP Test Code

Copy Code code as follows:

<?php
$connection = Ssh2_connect (' 192.168.255.128 ', 22);
Ssh2_auth_password ($connection, ' root ', ' 123456 ');
Ssh2_scp_send ($connection, ' d:/tmp/test.txt ', '/tmp/test.txt ', 0644);

Test Effect Diagram:

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.