Reputation: 5869
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
'?
Upvotes: 0
Views: 3105
Reputation: 4350
PHP is a service. You can either run killall php
or killall php-cgi
in 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.
Upvotes: 1