PHP code example of tiagobutzke / php-remote-server

1. Go to this page and download the library: Download tiagobutzke/php-remote-server library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tiagobutzke / php-remote-server example snippets


$remoteServer = new \RemoteServer\RemoteServer(
    new \RemoteServer\Ssh()
);

$remoteServer->connect('127.0.0.1', 'username', 'password', 'port');
$remoteServer->execute('ls -la');
var_dump($remoteServer->getResult());
var_dump($remoteServer->getArray());

$remoteServer = new \RemoteServer\RemoteServer(
    new \RemoteServer\Telnet()
);

$remoteServer->connect('127.0.0.1', 'username', 'password', 'port');
$remoteServer->execute('ls -la');
var_dump($remoteServer->getResult());
var_dump($remoteServer->getArray());

// apt-get install libssh2-php
// /etc/inid.d/apache2 restart