php-ssh2 extension tutorial for installing php under windows7_PHP tutorial

WBOY
Release: 2016-07-13 10:26:33
Original
846 people have browsed it

Because I wanted to transfer files to the test server and saw that PHP supports ssh operation, I sorted out the installation process and shared it with you.

Installation steps

1. Download php extension ssh2
Download address http://windows.php.net/downloads/pecl/releases/ssh2/0.12/

Download according to your PHP version. I am using thread safety, so I downloaded php_ssh2-0.12-5.4-ts-vc9-x86.zip

2. After decompression, there will be three files, libssh2.dll, php_ssh.dll, php_ssh2.pdb.

3. Place 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, and you can use php to perform ssh connection operations.

Check phpinfo() to see if the php_ssh2 extension is loaded successfully.

PHP test code

Copy code The code is as follows:

$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 renderings:

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/824629.htmlTechArticleBecause I wanted to transfer files to the test server and saw that PHP supports ssh operations, I sorted out the installation. Let’s share the process with you. Installation steps 1. Download php extension ssh2...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template