I'm trying to execute a script named csearch.php five times with the interval of 60 secs. I tried shell_exec and exec but it says, it can't fork, etc. I think the best way (since this is on a shared host) is by using include().
include('csearch.php');
sleep(60);
include('csearch.php');
sleep(60);
include('csearch.php');
sleep(60);
include('csearch.php');
sleep(60);
include('csearch.php');
csearch.php contains functions, etc. I'm wondering if this is possible (the above code). If not, what's the best way you can recommend? Thanks.
Edit, this is how I do it with exec and fails:
exec('/path/to/php /path/to/csearch.php');
exec()? This is how you should do it and it should work. Plus, you can'tinclude()the same script...include_once()for cases where you don't want to.