I need to do this for a special application I am building. The following is what I have done but it stops after about 20minute. I think it runs out of memory. On the page reload1.php I have put the code:
<?php
//I have put my php code in this area. normal code that is working ok
bla...bla...bla in php!
//Now at the end of my bla.. bla... code I call (by include) the other page called //reload2.php like so;
include ("reload2.php"); //this includes relaod2.php
?>
//Now my trick is I have the same bla.bla.bla code on reload2.php and make it call relaod1.php as follows:
<?php
//I have put my php code in this area. normal that is code working ok
bla...bla...bla in php!
//Now at the end of my bla.. bla... code i call (by include) the other page called reload2.php
include ("reload1.php"); //this includes relaod1.php
?>
By doing this I hope to create an indefinite cycle of reload1.php calling reload2.php and then reload2.php calling back reload1.php. Perpetual machine? Yes!!! At the first it was working just for a few seconds. I realized I needed to change "resource limits" on the php configuration file (php.conf). I changed to below
max_execution_time = -1 ; Maximum execution time of each script, in seconds(30)
max_input_time = -1 ; Maximum amount of time each script may spend parsing ;request data(60)
memory_limit = -1 ; Maximum amount of memory a script may consume (16MB)
I changed the parameters above to -1 to make them limitless.(otherwise the default are the values show in brackets). This improved my perpetual machine to run from seconds to over fifteen minutes. But I don't want it to stop at all (unless i say so).
Windows Task Manager shows that PF (memory) usage fills up slowly untill it matches that of the available RAM, and then the whole thing stops. This happens even when an I have put nothing in the code to echo to the browser.