0

I have triggered a PHP file which has an infinite loop, with:

shell_exec('php '.__DIR__.'/serv.php 2>&1 > /dev/null &');

and now I can't to stop it.

Is there any way to do it with 'shell_exec' or 'exec'?

1
  • instead of killing all php procceses just kill the one, if you have use htop, f3 > search > php > find it > f9 > kill it > with fire > 9 Commented Aug 21, 2013 at 14:52

2 Answers 2

1

PHP is a service. You can either run killall php or killall php-cgiin shell or, if you are using a program like MAMP or WAMP, you can simply close and reopen the program. Also, if you are using a later version of PHP there should be infinite loop failsafes. Check your php.ini for max_execution_time to see how long the script should be allowed to run. You can also set this in your file using the set_time_limit function.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, killed with 'killall php' ;)
0

just run the following on your shell

killall php

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.