Windows7 installation of php php-ssh2 extension Tutorial _php instance

Source: Internet
Author: User
Because I want to do a test server file requirements, see PHP support SSH operation, so the next installation process, share with you.

Installation steps

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

According to your own version of PHP to download, I am using thread-safe, so the 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. Put Php_ssh.dll, php_ssh2.pdb in your PHP extension directory under php/ext/.

4. Copy the Libssh2.dll to the C:/windows/system32 and C:/WINDOWS/SYSWOW64

5. Add Extension=php_ssh2.dll to the php.ini

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

View Phpinfo (), whether there is a display PHP_SSH2 extension loaded successfully.

PHP Test Code

Copy the 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:

  • 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.