Xu Wei Jie Posted March 23, 2009 Share Posted March 23, 2009 Is there a function call to kill all existing PHP processes? I am currently having system() to fork multiple instances and wish to kill them all by invoking that function. exit and die would not work because it only kills off 1 process. Quote Link to comment https://forums.phpfreaks.com/topic/150687-killing-off-processes-in-php/ Share on other sites More sharing options...
shadiadiph Posted March 23, 2009 Share Posted March 23, 2009 kills most things dead session_destroy(); header("Location: index.php"); exit; Quote Link to comment https://forums.phpfreaks.com/topic/150687-killing-off-processes-in-php/#findComment-791609 Share on other sites More sharing options...
Xu Wei Jie Posted March 23, 2009 Author Share Posted March 23, 2009 However, I am not writing a web application but console based. session won't help, right? Quote Link to comment https://forums.phpfreaks.com/topic/150687-killing-off-processes-in-php/#findComment-791948 Share on other sites More sharing options...
Maq Posted March 23, 2009 Share Posted March 23, 2009 What os are you on? If you're on linux you can do something like: shell_exec("killall php"); Quote Link to comment https://forums.phpfreaks.com/topic/150687-killing-off-processes-in-php/#findComment-791953 Share on other sites More sharing options...
Xu Wei Jie Posted March 23, 2009 Author Share Posted March 23, 2009 I am on windows. But i need to make it platform independent. And I do have 1 particular PHP process which I do not wish to kill. the others i want to kill them all. Quote Link to comment https://forums.phpfreaks.com/topic/150687-killing-off-processes-in-php/#findComment-791971 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.