PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Premature end of script headers error

  1. Hi, I'm working on a form found here:

    When the form is submitted I get a 500 internal server error, and the error log's error is just this:

    [Sat Nov 05 16:09:57 2011] [error] [client] Premature end of script headers: php5, referer:

    If I turn debugging on, TONS of errors are spit out, most of them relating to the theme:

    And if I preview the form through the admin on its own page, it submits just fine. Does this mean that all the errors from the theme are breaking the form submission? Is there any way around this? It's not my theme, it's an older one, and I'm not going to go back and update their code to remove all those errors.



    Posted 4 years ago on Saturday November 5, 2011 | Permalink
  2. If it submits fine from the preview, it is likely a theme or plugin conflict. You can determine which by testing

    You can quickly determine if it's the theme causing you trouble by activating the default Twenty Eleven theme and see if it works.

    You don't need all the output from debug, but you do need a more verbose error message. "Premature end of script headers" means there was unexpected output. But we don't know what that was, or why it's happening.

    Also, be sure you have the latest WordPress and Gravity Forms version. If that's the case, you might have to fix some portions of the theme to get this working.

    Posted 4 years ago on Wednesday November 9, 2011 | Permalink
  3. Oddly enough, I just submitted a test, and the submission went through fine and I saw the confirmation message. Maybe you have already fixed the problem? If so, can you tell us what you did? Thank you.

    Posted 4 years ago on Wednesday November 9, 2011 | Permalink
  4. Chris - thanks for looking into this. Strangely enough, I didn't do anything. And during my testing this happened a few times, but I just regarded it as something I changed in the code to make it work. But I haven't touched the code at all since I posted this message.

    Posted 4 years ago on Wednesday November 9, 2011 | Permalink
  5. I submitted a few more test entries and it seems like the form is working correctly now. Could the error still be related to the theme?

    Posted 4 years ago on Wednesday November 9, 2011 | Permalink
  6. It's possible. It could also have been some sort of problem with the server itself related to php5. Hard to tell without being able to reproduce the issue.

    Posted 4 years ago on Wednesday November 9, 2011 | Permalink
  7. rdooh

    I have had the same sort of problem - inconsistent failure yielding the 'premature end of script' error.

    - server/host: MediaTemple (gs)
    - form submission sometimes fails, sometimes passes - no definite pattern
    - when a submission fails, usually the Notification to User goes through, but Notification to Administrator does not
    - making these two messages identical does not have any effect
    - removing the Notification to User (ie performing a mail operation only once) seems to resolve the failure

    - there is something about having the plugin send out mail to multiple groups on this particular server setup that chokes the server on the second mail attempt

    I don't know much about server environments, nor have I taken a good look at the mechanics of the Gravity plugin to speculate further. I would be curious to know if other people are having this problem with the same host, or if there are other known "gotcha's" with calling mail() multiple times...

    Posted 4 years ago on Thursday March 22, 2012 | Permalink
  8. rdooh

    Update regarding the points "Strangely enough, I didn't do anything... seems like the form is working correctly now."
    - I have had the same sort of experience where if I resubmit after a failure, it 'magically' starts working. However, I have also found that things may just as 'magically' stop working with no changes to the code. In some cases, I saved some new settings for the form (like bcc email addresses), and in others, just changed the test data submitted... sometimes it seems like there is a 'caching' aspect involved, where significant changes 'break' things temporarily, and then repeated use 'fixes' it again. Doesn't make much sense to my, but maybe there is something going on at the server end where things become dislocated...

    Posted 4 years ago on Thursday March 22, 2012 | Permalink
  9. @rdooh, we are using the same server/host set-up, i.e., MediaTemple (gs), and are seeing the "premature end..." error in our error logs after an Error 500. I am investigating, but please post if you find anything useful.

    Posted 4 years ago on Saturday March 24, 2012 | Permalink


Support Tickets

Open A New Support Ticket
 Open A New Priority Support Ticket *

* Developer license holders only