I have a shell script located in /usr/chat/bin on my server that I want to execute easily on one of my sites (I will limit access to it). I created the following page:
<?php
echo "<html><head></head><body>";
if($submit)
{
exec("../../../usr/chat/bin/chatserver.sh &");
echo "The chat server has been restarted.<br><br>";
}
echo "Click the button below to restart the chat server.<br><br>";
echo "<form action=\"XXXXXXX.php\"><INPUT type=\"submit\" name=\"submit\" value=\"Restart Chat Server\">";
echo "</form>";
echo "</body></html>";
?>
Submitting the form does actually make the shell script execute and restart the chat server, which is what I want...but the php page as it's executing the script takes forever to load (I let it sit there for 5 minutes just to see what would happen, and it was still loading), and I'm wondering why. Is there something else I need to do, or a different function besides exec() that I should use?