We want to kill Currently running Apache process using PHP, i am using windows machine with XAMPP server.
I am building application which need to restart Apache automatically after 5 hours , so thought of using PHP coding to stop all existing process of apache and than start again.
Please advise me if anybody has other solution.
system()andexec()is the only way I can think of. But the PHP process needs to run as a user who can do this (usually only root can) and letting a PHP script run as root is not a good idea as long as it is public. Inside a cron job I think there is no problem.cronon windows. Test your PHP script from PHP CLI and useScheduled Tasksto run your command.