How to run a .sh file over ssh via php?
-
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
-
<?php
$result = exec ('/var/www/up.sh');
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_execAnonymous
1 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!