I'm trying to restart a Linux service, but it does not work for me.
I have this piece of code taken from the web:
<form action="reset.php" method="post">
<input type="submit" value="Reiniciar" class="button" >
</form>
And this is the reset.php
:
<?php
$output = shell_exec("service garen restart");
echo "<pre>$output</pre>";
?>
When I give the button to execute reset.php
, it goes blank and does not execute the command.
If I add sudo
to the command it does not work either and the log indicates:
sudo: no tty present and no askpass program specified