PHP code example of omniglies / laravel-server-manager
1. Go to this page and download the library: Download omniglies/laravel-server-manager 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/ */
omniglies / laravel-server-manager example snippets
use ServerManager\LaravelServerManager\Services\SshService;
$sshService = app(SshService::class);
$config = [
'host' => 'your-server.com',
'username' => 'user',
'password' => 'password', // or use 'private_key'
'port' => 22
];
$connected = $sshService->connect($config);
if ($connected) {
$result = $sshService->execute('ls -la');
echo $result['output'];
}