标签:技术分享 connect bin 分享 locking use 需要 nts 扩展
php -v
brew install homebrew/php/php55-ssh2
【实现方式】
<?php $connection = ssh2_connect(‘192.168.0.145‘, 22); ssh2_auth_password($connection, ‘username‘, ‘password‘); $stream = ssh2_exec($connection, ‘/usr/local/bin/php -i‘); stream_set_blocking( $stream, true ); echo (stream_get_contents($stream)); $stream = ssh2_exec($connection, ‘ls‘); stream_set_blocking( $stream, true ); echo (stream_get_contents($stream)); ?>
标签:技术分享 connect bin 分享 locking use 需要 nts 扩展
原文地址:http://www.cnblogs.com/renxing123/p/6497962.html