Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Hosting Requirements /

What you need to consider when choosing a hosting provider and plan.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

"Premature end of script headers: main.php" after server update

Go to End

4 Posts   3329 Views


Community Member, 89 Posts

23 February 2014 at 10:30am

Earlier today I upgraded my cPanel server using EasyApache from PHP 5.3 to 5.4, I also included Xcache, and I think mod_pagespeed was also added.

After the upgrade all my SilverStripe 3.1 sites were just returning 500 Server Errors, which I eventually tracked down in the logs as:

Premature end of script headers: main.php

Doing a dev/build on each site seemed to fix the issue, but it was a real pain to have to enable dev mode on each site config, and then dev/build (I have over 50 SilverStripe sites on my server).

Any idea what caused this? My guess is some kind of database issue. Something to do with InnoDB? Which I don't know much about.

I wasn't able to work out exactly why a dev/build fixed the sites, but I'd like to understand in order to avoid the issue in future.

I've still got a few (unused) sites that I haven't run dev/build on yet, so happy to have a play if you have any suggestions to work out exactly what caused this.



Community Member, 8 Posts

20 September 2014 at 10:31am

I can confirm this is happening to me on php 5.3.29 . SS 3.1.6 . Can't find obvious reason :(


Community Member, 89 Posts

23 September 2014 at 4:37am

I never got to the bottom of this, not had it again since dev/building each site.


Community Member, 187 Posts

24 September 2014 at 2:07am

Edited: 24/09/2014 2:08am

Hi guys,

I seem to remember seeing a bug report about this before. I believe it was something to do with the PHP class manifest - there are some differences for PHP 5.3 vs 5.4, so after an upgrade it just needs to be cleared and rebuilt. I think there was a ticket on Github for it, too.


-- edit --

This might be the one I’m thinking of: