I'm having trouble writing a php CRON script that will be used to get data from an API. I get a 500 error and log entry "Premature end of script headers: myfile.php" whenever running it. Simplified, the script is the following (which still produces the error).
$time = 45;
while ($i < $time)
echo $i . '
sleep(1); //mandatory sleep call
This is not memory intensive and shouldn't time out...it has me completely stumped.
I am using the default php settings and the load of my shared server is
21:02:47 up 51 days, 22:27, 1 user, load average: 4.65, 4.24, 4.07.