/RemoteExec

Primary LanguagePHPGNU General Public License v3.0GPL-3.0

RemoteExec

Required Libarary

https://pecl.php.net/package/ssh2

Demo

<?php
include 'RemoteExec.php';
$result = Remote::Exec('127.0.0.1', 22, [
    "type" => "password",
    "username" => 'root',
    "password" => '',
], [
    // [
    //     "name" => "restart_fpm",
    //     "command" => "service php7.0-fpm restart",
    // ],
    [
        "name" => "count_fpm_thread",
        "command" => "ps -aux|grep -c php-fpm",
    ],
]);
print_r($result);

Snipaste_2018-04-25_22-34-22.png