Support » Fixing WordPress » Premature end of script headers: index.php

  • My site was running just fine up until about half an hour ago when I attempted to access my index page and I am now getting 500 Internal Server Errors. I checked my error logs and I am getting the following error message:

    Premature end of script headers: /home/xxxx/public_html/index.php

    I am able to login to WP and move around within it, but I just can’t get my index.php page to load. I have contacted my host (Jaguar PC) but haven’t heard back yet. I did notice that they upgraded their system and Cpanel so I’m not sure if something on this end is causing the problem or if my WP just pooped out on me.

    Any suggestions?

Viewing 15 replies - 1 through 15 (of 19 total)
  • And here is my host’s response:

    “I have checked in detail. Everything is same as before on the server. Nothing has been changed regarding any setting. The problem seems to be with scripts. Please make sure that you have not changed any paths of your scripts. I have checked few of your scripts are using the “require_once()” function.”

    I haven’t done anything with my WP or any scripts so I am at a loss as to what is causing this so I have no idea how to fix it.

    Can anyone offer me any help?

    Find a new host? :-p

    What happens if you change themes? Does your site work with Default or Classic?

    Well dang! Let me try that and see… nope. That doesn’t work either. Still getting inter server errors. The strange thing is that everything else works. My WP itself works and I can see individual entries and my WP pages. Example below: – no workie – workie

    So it’s obviously just my index.php file but I can’t figure out what the hell is going on. =(

    PS – How on earth do I quote text in this forum??

    And of course my host is now pulling their infamous “it’s a script issue with WP and we don’t support WP.” They are telling me that it’s a script issue because my index page is using includes and calling in files from other pages and directories. Well, my sub-pages within WP are set up the exact same way as my index file which means if that were the case then my sub-pages would be giving 500 internal server errors as well.

    Could somebody please help me try to figure out what’s going on? I don’t want to have to wipe everything out and start over but it’s obvious I’m not going to get any help from my host and I’m tired of their blaming my website problems on WP as a way to get out of actually helping me.

    I’m going to go into serious girl mode and start bawling in a minute. Ugh!

    Isn’t there a way to get the actual error to print to the browser to find out what exactly is causing the error? I’m looking on the Internet right now but haven’t been able to find anything in layman’s terms.

    Something like this at the top of the index.php I think?

    <?php error_reporting(E_ALL); ?>

    Have you installed a plugin recently? If so, try disabling it (or them).

    Also, oftentimes a 500 error is related to the Apache mod_rewrite code, so you could (temporarily) remove the .htaccess from your root directory to see if that clears it up.

    HandySolo – that didn’t work. I couldn’t get it to print out the actual error.

    Kaf – I removed my mod_rewrite code from my .htaccess file and I am still getting the 500 Internal Server errors.

    If I could find out what the actual error is, or what script is causing it, I would have a better shot at figuring this out. It’s so frustrating.

    Are you able to FTP into the site — and verify that the index.php has the correct file date as the one you originally uploaded? You could also try uploading a new index.php.

    The other thing that comes to mind is a blocking of the root directory (that is, via either the .htaccess file or the server configuration file. It’s pretty easy to make a mistake with those.

    I haven’t made any modifications to my .htaccess file recently. I can FTP in and I have tried replacing the index file with a new one. I even tried resorting back to one of the default themes and the same errors keep occurring.

    I’ll ask my host if they have somehow blocked my index file by mistake. They keep saying it’s a WP issue though.

    Interesting, here is the reply from my host:

    I have digged this issue further and the problem that I am able to identify is with the IP that was causing the issue. It appears strange but I have checked it because your website was not loading directly but when I accessed it using the temporary URL then it loaded fine. I have changed the IP of your domain and it will take couple of hours for the DNS propagation. After that the domain will start loading fine.

    Their response was at 5:50 a.m. this morning it’s now 9:00 a.m. my time and I’m still getting the errors on my index page. I just knew it wasn’t a WP issue. I am SO tired of hosts always wanting to blame WP whenever there is an issue. I think sometimes they take that route just to get out trying to figure out what is actually going on.

    I guess I just wait and see now.

    Well I did a little test on my own. I removed the WP index.php file from my root directory and replaced it with a test index file and that file showed up fine with no errors. When I replaced the test index file with the WP index file, the errors are now back. Here’s what’s in the index file in my root directory:

    /* Short and sweet */
    define('WP_USE_THEMES', true);

    So it does appear that the problem is with this index file but my problem is that I can’t figure out what’s causing the premature end of script headers error and why this is happening all of a sudden with no changes to my WP installation, etc. Any other thoughts or ideas?

    I’m not sure if this related at all, but I did have an issue last week after activating the AMM plugin. I get the following errors whenever I activate a plugin:

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xxxx_wordpress' at line 1]
    SHOW TABLES FROM xxxx_wordpress;
    Warning: in_array() []: Wrong datatype for second argument in /home/xxxx/public_html/wp-content/plugins/amm.php on line 41
    Warning: Cannot modify header information - headers already sent by (output started at /home/xxxx/public_html/wp-includes/wp-db.php:104) in /home/xxxx/public_html/wp-content/plugins/post-levels.php on line 103
    Warning: Cannot modify header information - headers already sent by (output started at /home/xxxx/public_html/wp-includes/wp-db.php:104) in /home/xxxx/public_html/wp-content/plugins/post-levels.php on line 104

    But the error went away after I activated the plugin and I haven’t seen it since, until today when I went to deactivate and reactivate a plugin. Could this error be connected to the problem with my index.php file and if so, why did the problem with my index.php file just show up yesterday and not last week? Just trying to throw things out there to get this fixed.

    Okay, it turns out this is some sort of a WP issue. Here’s my latest update from Support:

    Yes I can see the IP is propagated and it appear to be some thing more than IP issue , what I have tracked is that the require function in your index.php is throwing the error , you have below code there:

    /* Short and sweet */
    define('WP_USE_THEMES', true);

    The line ‘require(‘./wp-blog-header.php’);’ is loading the page and this is the line throwing the error , but if this page is loaded directory it loads fine , please see the link below:

    Have you tried using some other function for including the page , I believe its the require function causing this issue. Please tell us if some other include function works for you.

    So it appears there is some sort of problem with my function but again, I don’t know what would be causing this all of a sudden.

    Is there another way to call this function so my main index page will work again?

    Okay, sorry for all the posts on this topic! My website is back up and running but my Support had this to say about my WP:

    We have looked into it in detail. Due to RLimitMEM parameter of Apache the error was generated. We have now increased the parameter and your site is now loading fine. Please check at your end to confirm.

    And a reply to me in their support forum said this:

    Your WP is hitting memory limits. I have increased the process memory. You may still check with wp to make sure you have the latest/stable version.

    What would cause WP to hit it’s memory limits? Was the problem really caused by WP or are they just saying that to get out of compensating me for my downtime? Inquiring minds want to know!

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Premature end of script headers: index.php’ is closed to new replies.