I have a php script which needs to restart lighttpd. The php page never returns to the client. I believe that is because the call doesn’t return. Here is my code:
<?php
exec("/etc/init.d/lighttpd restart");
echo "Restarted!";
?>
If I comment out the exec line it returns as expected.
How can I get this call to return?
Thanks,
EV
If you restart you httpd process your scripts will be terminated, no matter what you do!
You will never make any scripts to return a value directly from PHP. To make that work you should add a javascript and check for a
200Status Code.