Re: Dreaded Premature end of script headers
| From: | Geoff Shang | Date: | Fri, 26 Aug 2011 18:42:35 +0000 |
| Subject: | Re: Dreaded Premature end of script headers | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-314627@lists.php.net to get a copy of this message | ||
On Fri, 26 Aug 2011, tamouse mailing lists wrote:
The log says what I said: Premature end of script headers <filename>I put this into Google and got this: http://htmlfixit.com/cgi-tutes/tutorial_Common_Web_dev_error_messages_and_what_they_mean.php#premature As I understand it, the webserver is complaining that it did not get all the headers it expected from the script before it terminated. Given that you say this is for a cron job, the script may well be doing exactly what you want it to do, but it's not outputting anything which is why you get an error. Presumably, you are calling this cron job with some process which runs the PHP script through a URL on your webserver. To fix this, I'd suggest one of the following. Either: 1. Modify the script so that it does actually output something, thereby making the error go away. or 2. Run the script directly with PHP instead of via your webserver. E.g.: php -f <yourscriptname> IMHO, 2 would be the better way to go if you can do this. HTH, Geoff.