WordPress.org

Forums

500 Internal Server Error - WP 2.1 (19 posts)

  1. tuntis
    Member
    Posted 8 years ago #

    I've got WP 2.1 running on a shared Linux hosting account. 500 internal server error shows up about half the time (but not always). This is how my WordPress has been set up:

    K2 theme (happens on other themes too :/)
    http://www.domain.domain/wordpress/ - Directory
    http://www.domain.domain/ - URL to blog
    All plugins disabled:
    htaccess: http://wordpress.pastebin.ca/349563

    Please note that the error doesn't show up all the time; but it does show up on every page "when it shows up". I need help with this, any ideas?

  2. Samuel B
    moderator
    Posted 8 years ago #

    If it's doing this randomly and on every page, it's almost 99% certain your host is dropping the server connection occasionally for whatever reason. Maybe you should ask them if they are/have done upgrades/changes recently.

  3. tuntis
    Member
    Posted 8 years ago #

    "
    Thank you for contacting Online Support. We are not currently experiencing any issues with our hosting accounts. This error indicates that you are using more than the number of concurrent connections allowed for your hosting plan. If you require more connections, you will need to upgrade.

    These are the limits.

    Economy: 50 connections
    Deluxe: 100 connections
    Premium: 150 connections"

    I am on "Economy"; what should I do?

  4. davidchait
    Member
    Posted 8 years ago #

    switch providers.

  5. h2ocello
    Member
    Posted 8 years ago #

    @tuntis

    I'm having a (possibly) similar issue:
    - shared Linux
    - WP 2.1
    - intermittent 500 Internal Server Errors
    - happening in various themes (I use MistyLook)

    My issues that are not similar:
    - usually only occurring on home page

    My issues that may or may not be like yours:
    - error occurs the same in FF and IE (have not tested other browsers)

    If you change your Home Page to something other than most recent posts, do you still get the error? When I do that, my error immediately & completely disappears. Only thing I've been able to figure out so far, is the error seems to be tied to publishing posts to Categories (Tags) - either certain ones or ones that are nested 3-deep (Example nested hierarchy: Food > Lunch > Sandwiches).

    When I
    (1) change my newest ("offending") post to draft AND
    (2) make my Home Page show most recent posts again
    the Home page is fixed.

    Also when I
    (1) change categories for my new post (like only post to categories/tags that are 1-category deep) AND
    (2) republish my new post AND
    (3) make my Home Page show most recent posts the Home Page is fixed.

    Not sure if I'm on the right track or not, but for now this seems to be the fix for me. I'm keeping track of my intermittent 500 Internal Server Errors and the fixes here.

  6. navigadget
    Member
    Posted 8 years ago #

    I also am having same "500 internal server error" problems. It is almost at random, could happen on any page (except admin side), and goes away after a couple of refreshes.

    The number of 500 errors increased considerably after upgrading to 2.1. Back at 2.0.x it was neglible. Now it is not. Need to fix it this time.

    Any ideas?

  7. Daniel Jalkut (Red Sweater)
    Member
    Posted 8 years ago #

    Glad I found this thread - I have asked about this in IRC and on a mailing list with no luck so far, so I'm glad to learn that I'm not alone. Definitely noticed this go way up starting in 2.1. I just updated to 2.1.1 and have seen the bug twice since then.

  8. crimsoncor
    Member
    Posted 8 years ago #

    I'm having the error as well. I'm trying to figure out the problem with my host. First step is trying to get the server error logs from them so I can figure out which scripts are actually causing this problem. Anyone else had any success getting error logs?

    I've currently got the front page of my blog turned to a static page where I'm tracking progress on this issue (crimson.nowrench.com)

  9. crimsoncor
    Member
    Posted 8 years ago #

    alright, there is closed bug over here (closed, but never fixed) about server 500 errors relating to long posts.

    Is anyone having this problem only with long posts on the front page or is it random . . .

  10. navigadget
    Member
    Posted 8 years ago #

    I looked into my access logs and saw that I had 10,780 (yes, ten thousand!) of these 500 Internal Server Errors.

    For me, I haven't seen any correlation between the size of the post and likelihood it'll be a 500 error.

  11. navigadget
    Member
    Posted 8 years ago #

    However I do get them very often in my "post preview" window.

  12. navigadget
    Member
    Posted 8 years ago #

    I contacted my host and here is what they said:

    An error 500 occurs most often when either your logs have become to large, or in many cases, when there are too many open connections to your database at the same time.

    Please check your PHP encoding and ensure that all of your database calls fully close to ensure that they are not being left open, which can cause an increase in these errors.

    Did 2.1 increase the number of mysql connections it requires? (compared to 2.0.7)

    Any help is appreciated.

  13. crimsoncor
    Member
    Posted 8 years ago #

    I contacted my host. They reviewed the logs and said that it was their problem and they had something configured wrong. They went and fixed something (wouldn't tell me what) and now everything seems to be working fine (at least I haven't got any more Server 500 errors). Wish I knew what they did so I could share it.

  14. h2ocello
    Member
    Posted 8 years ago #

    @navigadget

    Regarding your host's comment:

    Please check your PHP encoding and ensure that all of your database calls fully close to ensure that they are not being left open, which can cause an increase in these errors.

    WordPress does not explicitly close database connections. It relies on PHP to automatically close them at the end of script execution.
    See this: WordPress Support > Closing db connections

    On PHP.net, on their page about mysql_close() they discuss the issue of closing databases explicitly. I am not an expert, but it appears it's typically 'bad form' to explicitly close db connections. The database will close as soon as its script finishes. After reading that a few weeks ago on PHP.net (when I was researching the very same thing) I decided to remove all the mysql_close() commands I'd written into some PHP scripts I run (not my WordPress blog--it was for something else) and I have seen an improvement in speed on those scripts since then. And no 500 internal server errors on those sites either, not that I'd ever had them before.
    See this: PHP.NET mysql_close page

    I posted my 500 internal server error issues in this topic a few weeks ago. I've had no issues at all since updating to 2.1.2, knock on wood. I'm not sure if that has anything to do with not seeing the error anymore. I do still watch for it.
    My 500 internal sever error problems and related discussion.

  15. vkaryl
    Member
    Posted 8 years ago #

    Better check with your hosts, those still having problems: the php 4.4.5 release had some issues, perhaps similar to this; my host retrograded to 4.4.4 until 4.4.6 was released. If your host is NOT running 4.4.4 or 4.4.6, ask them to fix at least your server space by downgrading to 4.4.4 or upgrading to 4.4.6.

    You can do a quick check yourselves to see what php version: create a file in notepad (NOT WORDPAD OR WORD); save it as phpinfo.php. In the file put this and only this, and save it:

    <?php
    phpinfo();
    ?>

    Upload this to your site root; access using your browser (something like http://yourdomainname.com/phpinfo.php) - this will give a lot of info about what the backend programs running your site are set up with, including what versions of apache, php, mysql, etc.

  16. bgswm1
    Member
    Posted 8 years ago #

    I am having this same problem, and I have a dedicated hosting plan. It definately has something to do with new posts being added. On my site, we set posts to post for future times/dates, and once the post time hits, the site goes dead with the following error:

    Error establishing a database connection

    This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at localhost. This could mean your host's database server is down.

    * Are you sure you have the correct username and password?
    * Are you sure that you have typed the correct hostname?
    * Are you sure that the database server is running?

    Nobody seems to know what's going on here, but it sounds like it's a huge issue.

  17. h2ocello
    Member
    Posted 8 years ago #

    @bgswm1

    That sounds like a different error than the posts in this thread. The sole error I get that this thread references is '500 Internal Server Error'. Regardless, have you tried unpublishing the 'culprit' post by changing it to Draft? Tried to remove tags for the article?

    I read in another of your postings you use GoDaddy. I have GoDaddy too, although I haven't had the 500 Error problem occur now for several weeks. I'm running WordPress 2.1.2.

    @vkaryl

    My PHP version is actually older than all you mentioned, 4.3.11.

  18. MarioMansour
    Member
    Posted 7 years ago #

    I have this problem too with Godaddy hosting. The MySql server is getting down 90% of the time and when I ask godaddy to fix the problem they reply with this "Try to optimize your code" because it seems that there are database connections that are not being closed which causing the server to get overloaded.

    I tried to find about closing database connections in wordpress, and it seems that wordpress doesn't explicitly close database connections and relies on the PHP server to close them when the script ends.
    I have other pages that I have written myself outside wordpress where I use mysql_close() to close the database connection. I was convinced that my own scripts were not the problem since I was not leaving any database connection opened, but if the PHP server also closes the connection that wordpress opens why do I still getting this message

    Unable to connect to database : Too many connections

    I have found in different posts that Godaddy sucks, I believe it is, but I'm not willing to change a host at the moment since I just bought a one year dedicated server with them and too bad the business is not working fine. I just want to fix the problem with Godaddy to finish the year with minimum losses.

    I know there are plenty of people out there with similar problem with Godaddy, I appreciate if anyone could give me a clue how to solve this problem beside having to switch the host. Thanks

    Mario Mansour

  19. givver
    Member
    Posted 7 years ago #

    I to had this problem. I am using GoDaddy as my host and I finally tracked down to the problem to WP-Cache. I have the problem fixed now and WordPress is working happily with WP-Cache and I even have it working with GZIP. If you would like to see how I fixed it then check out my blog. I also have a download link to to a modified WP-Cache that works with GoDaddy.
    http://www.givveronline.com/wordpress/godaddy-internal-server-error/

Topic Closed

This topic has been closed to new replies.

About this Topic