ShivaGupta Posted September 22, 2013 Share Posted September 22, 2013 Is there a way of killing all running PHP script in my linux hosting? Quote Link to comment Share on other sites More sharing options...
jazzman1 Posted September 22, 2013 Share Posted September 22, 2013 (edited) You are surprising me every time What that question is Edited September 22, 2013 by jazzman1 Quote Link to comment Share on other sites More sharing options...
ShivaGupta Posted September 22, 2013 Author Share Posted September 22, 2013 You are surprising me every time What that question is as the google First check all the PHP processes using the below command ps aux | grep php Then get all the Process Ids from the above command ps aux | grep php | awk '{print $2}' Then kill all the processes kill -9 `ps aux | grep php | awk '{print $2}'` i am try with <?php ps aux | grep php ; ps aux | grep php | awk '{print $2}' ; ?> and result is Parse error: syntax error, unexpected T_STRING in /htdocs/public/www/tests/index.php on line 5 help me out plz......... Quote Link to comment Share on other sites More sharing options...
kicken Posted September 22, 2013 Share Posted September 22, 2013 Those are not PHP code, they are shell commands. You'd SSH into your host and run them on the command line. Quote Link to comment Share on other sites More sharing options...
ShivaGupta Posted September 22, 2013 Author Share Posted September 22, 2013 Those are not PHP code, they are shell commands. You'd SSH into your host and run them on the command line. ok sir but is their any php code to kill...prosses Quote Link to comment Share on other sites More sharing options...
axxo1 Posted September 22, 2013 Share Posted September 22, 2013 Is there a way of killing all running PHP script in my linux hosting? Is this your server? If you are on some shared hosting service you can't kill all PHP processes, you would affect the other customers. Quote Link to comment Share on other sites More sharing options...
jazzman1 Posted September 22, 2013 Share Posted September 22, 2013 Try to set a php engine to off inside this particular directory. Never tested: http://www.electrictoolbox.com/disable-php-apache-htaccess/ Quote Link to comment Share on other sites More sharing options...
vinny42 Posted September 22, 2013 Share Posted September 22, 2013 The only things that are going to stop running process PHP is are a kill command and an apache restart. You cannot restart apache unless you are root (and if you were root you would not be asking how to stop a process). You can stry a kill command through a system() call, but if it's not your own private server and if the server is not setup very bady, you will simply not be able to do that. Remember, everything is built and designed to prevent hackers and bugs from stopping processes arbitrarily.... Quote Link to comment 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.