How to run a .sh file over ssh via php?

  • 0
    Found ssh2_connect () but don't understand how to use it, English documentation everywhere. Maybe there is some example with a Russian description?
    Ubuntu Anonymous, Jan 20, 2020

  • 1 Answers
  • 0
    $result = exec ('/var/www/');
    echo $result;
    if ($result)
    echo "Все хорошо.";
    if (!$result)
    echo "Ошибка.";

    unless of course the exec function is available, otherwise use either to connect to ssh.

    you can still try shell_exec

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!