Simulate Cron jobs using PHP
<p>I am running an LMS (Learning Management System) online and it needs to run a file called "training/admin/cli/cron.php" every minute. The problem is that my host only allows cron jobs to run every 30 minutes. </p>
<p>I tried creating a file called cron_script.php with the following content and setting it to run every 30 minutes: </p>
<pre class="brush:php;toolbar:false;"><?php
set_time_limit(0);
$turns=0;
while($turns < 30) {
exec('training/admin/cli/cron.php');
sleep(60);
$turns ;
}
?></pre>
<p>But it only seems to run once. I don't even know how to fix the error message since it is run by cron so I can't print it anywhere. </p>