I have a problem, I need to launch a .sh script from a web page, just does not go, starting from the terminal the script works and does what it has to do, but from the web no, but in the ' Apache2 error.log does not make any mistakes, I do not understand what it can be ..
HTML:
<tr>
<td>JTS</td>
<td>
<form action="JTSstart.php">
<input type="submit" value="START">
</form>
</td>
<td>
<form action="JTSres.php">
<input type="submit" value="RESTART">
</form>
</td>
<td>
<form action="JTSstop.php">
<input type="submit" value="STOP">
</form>
</td>
</tr>
PHP:
<?php
echo exec('bash JTSstop.sh');
sleep(5);
header("Location: 5ondimba.html");
?>
SH:
#!/bin/bash
cd /home/otaku/JTS3ServerMod_HostingEdition
./jts3servermod_startscript.sh stop
What I have tried / tested: 1) The exec command, such as shell_exec, is not disabled in the php setup. 2) The files were converted with dos2unix. 3) bash -x on the script and does not report any kind of error (in fact, from console works).
what could it be?? how can i make it work? Thanks so much!
</div>