Hello.
I have the following problem:
I have a php script, which is run every day by cron.
The cron runs wget
http://mydomain.com/cronscript.phpUnfortunately, for some reason the script cannot get executed to the end all at once. The cron is restarted multiple times, first time on 15 minutes, after that like every 1-2 min. I'm receiving the following message:
......
--02:19:01--
http://mydomain.com/cronscript.php (try: 7) => 'cronscript.php'
Connecting to mydomain.com[ip]:80... connected.
HTTP request sent, awaiting response...
End of file while parsing headers.
Retrying...
--02:21:47--
http://mydomain.com/cronscript.php (try: 8) => 'cronscript.php'
Connecting to mydomain.com[ip]:80... connected.
HTTP request sent, awaiting response...
End of file while parsing headers.
Retrying...
It usually takes around 7-8 tries to get to the end of the script.
The script itself might get pretty heavy and takes long to execute, as it uses qmail-inject to send newsletters to multiple subscribers. However it starts with
set_time_limit(0); //set max execution time 0 - forever
... So, this shouldn't be a problem at all. Additionally, I have the same stuff running on another server, with twice as many subscribers, and works perfectly on the other server. I tried to change wget with curl, the same thing happens: works fine on the "bigger" server, returns an error message in the "smaller" server:
curl: (52) Empty reply from server.
The script runs fine on both servers if there are no any newsletters to be send for the day.
I guess my question is, if anybody has an idea what is causing the script not to get executed all at once, what does this message "End of file while parsing headers" means and how it can be corrected to run as it's on the other server. What might be setting this limit - 15 minutes, as it's ignoring my php setting for any reason?
Thank you
Start Free Trial