1

I have a multi-site install of Wordpress running fine on a unmanaged CentOS server, however for a certain feature I need to do my own thing on certain pages and manually interact with some non-Wordpress tables.

When writing the script for the form actions, I've been getting a 500: Internal Server Error. Which according to the Apache logs is due to "end of script output before headers".

To check it wasn't just me doing something ridiculous, I tried just directly linking to the file and changing it to <?php echo "Hello World!"; ?>, but the issue has persisted. So it can't be an issue with the script itself.

Wordpress not having any issues implies it isn't necessarily PHP itself either...

I've tried Google-ing and trawling through here, but I can't seem to find a useful answers. Any help would be very welcomed. Thank you in advance.

1 Answer 1

1

It's been a while, but from what I remember, and what it sounds like you need to do is - at the beginning of your script check to see if the headers have been sent and send them if not.

That's assuming you aren't using the WordPress API and just rolling your own script that is being called for some reason.

2
  • Attempting to check to see if the headers have been sent didn't seem to help :/ Thank you for the response though
    – Solflux
    Apr 19, 2016 at 17:54
  • You would normally only need to "check to see if the headers have been sent" in case you needed to set an additional header (eg. a cookie). (Because attempting to set a header after the headers have already been sent would result in an E_WARNING.)
    – MrWhite
    Apr 25, 2018 at 1:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .