Re: Dreaded Premature end of script headers
| From: | Camilo Sperberg | Date: | Sat, 27 Aug 2011 06:01:42 +0000 |
| Subject: | Re: Dreaded Premature end of script headers | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-314630@lists.php.net to get a copy of this message | ||
I had the same problem the other day and it was because a certain index in an array didn't
exist, this array was constructed from the db and later i was trying to access this array.
So my best guess would be that if it happens only at production and db data is involved, i would
definitly think in arrays, indexes, limits, etc.
Sent from my iPhone 5 Beta [Confidential use only]
On 26-08-2011, at 19:49, tamouse mailing lists <tamouse.lists@gmail.com> wrote:
> On Fri, Aug 26, 2011 at 6:48 PM, tamouse mailing lists
> <tamouse.lists@gmail.com> wrote:
>> On Fri, Aug 26, 2011 at 1:42 PM, Geoff Shang <geoff@quitelikely.com> wrote:
>>> 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
>>
>>
>> Yeah, I saw that too. I do know the mechanism that is happening. I
>> just can't figure out where the problem is without inserting print
>> statements.
>>
>>> Presumably, you are calling this cron job with some process which runs the
>>> PHP script through a URL on your webserver.
>>
>> Yes, that is correct. Using curl to launch the script via the web server.
>>
>>> 1. Modify the script so that it does actually output something, thereby
>>> making the error go away.
>>
>>
>> When the script starts, it prints a banner with the script name and
>> date/time stamp. When it completes, it is supposed to print aggregate
>> results, time spent. I know it's encountering this problem before it
>> reaches the end as not all the data gets processed. I can't tell where
>> it is stopping though. If I put it in debug mode, it prints out a lot
>> of data from the beginning of the script, and never encounters this
>> problem.
>>
>>> 2. Run the script directly with PHP instead of via your webserver. E.g..:
>>> php -f <yourscriptname>
>>
>> The way the script is designed, it depends on some $_SERVER values,
>> which wouldn't be set if running directly from the shell.
>>
>
> Again, I want to say that this script does NOT fail in dev, test and
> stage, only production.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>