OS: Linux.
WHM, cpanel used.
PHP 5.3.2 (cli) (built: Jun 11 2010 02:25:31) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
<?php
exec("php xyz.php");
?>
starts calling the xyz.php innumerable times. the server hangs after sometime.
calling 'php xyz.php' from the console works fine.
The infinite loop We can create an infinite loop using while statement. If the condition of while loop is always True , we get an infinite loop.
What are infinite loops? An infinite loop is a piece of code that keeps running forever as the terminating condition is never reached. An infinite loop can crash your program or browser and freeze your computer.
What is an Infinite Loop? An infinite loop occurs when a condition always evaluates to true. Usually, this is an error. For example, you might have a loop that decrements until it reaches 0.
found the solution from
http://www.mombu.com/php/php-5-forum/t-24759-exec-or-system-et-all-cause-an-infinite-loop-of-starting-requested-program-8469354.html
<?php
exec("php-cli xyz.php");
?>
worked....
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With