I have the following which call the exec to run the script test.php in the background.
exec("/home/gooffers/test.php?one=one &");
Script test.php contains the following
$test = $_GET['one'];
echo $test;
However this is creating an infinite loop (infinite number of processes) which is crashing the server. Why is this happening.
$_GETis not availible when you are running a script via commandline (php-cli).See here on how to pass arguments to a command line script in php: How do I pass parameters into a PHP script through a webpage?
Basically, it’s
and then fetching them via