Get the Flash Player to see the slideshow.

Jul 06 2009

Upgrading WordPress: Troubleshooting HTTP 500 – Internal Server Error

Published by at 9:39 pm under IT

With the introduction of WordPress 2.7 upgrade capabilities for local installations are available right out of the box without the need of 3rd party plugins or manual update process.

While this is cool, can also be a tricky, not so straight forward process. If your blog is hosted by WordPress, you do not have to worry about anything as the upgrade is done automatically for everybody. If you host your own blog and use only standard themes an no additional 3rd party plugins, upgrade is also safe for you, as no compatibility issues can occur between versions upgrade. On the other hand, what’s the point of having your WordPress blog self hosted if you do not need the added value of 3rd party plugins?

You’ll need this guide if you host your own WordPress instance, you are using 3rd Party plugins and you are planning for an upgrade. I decided to write this guide after Aperture.ro was not available after upgrading from WordPress 2.7 to WordPress 2.8 via build in upgrade feature. Server displayed HTTP 500 error while loading the main page. Problem was fixed in 5 minutes. Here is how.

Majority of automatic upgrades are failing because one or more plugins that we’re compatible with the old version WordPress do not work with the new one. The question is how you can identify the bugger? There are different scenarios here:

1. Your WordPress is hosted by an ISP who offers standard PHP / MySQL functionality. You have access via cpanel or FTP to your site’ root, but no means of accessing PHP / MySQL error logs (and can’t be sure if the ISP is keeping such logs either).

  • If that’s your case, you can call the ISP to check for any bad references in the PHP error log and point you to the plugin(s) that’s causing the mess. If the ISP’ Customer Support department is on a team building in Honduras,
  • Logon via cpanel or FTP to your site’ root, make a note of all the plugins in wp-content/plugins/ folder. Copy all of the plugins to your local drive, delete all folders from wp-content/plugins/. Access your wordpress home page. It should work, as all plugins have been removed. Now the part which requires some patience: copy one by one each of the plugins from your local drive and make sure that after each plugin is copied, you do a functionality check of your WordPress blog (both the front page and admin logon). This way you can manually identify and remove the incompatible  plugin.

2. Your WordPress is hosted by you and you have full access to PHP.ini file. This will save you a lot of time and effort. Search for the following lines:

  • “error_reporting”. If the field is commented – has a semicolon (;) in front, remove the comment and turn the field into “error_reporting  =  E_ALL“. This will enable error reporting for all errors;
  • “log_errors”. Same as above, remove the comment and turn the field into “log_errors = On“. This tells PHP engine to echo errors to an external source, such as a file;
  • “error_log”. Remove comment and give the field a value which is the path and the error log file: “error_log = E:\Logs\PHP\error.log“. Replace here the value with a path & file name of your choice.

You have now enable PHP error reporting to a file. Access the site, you will get the same HTTP 500 – Internal Server Error message displayed, but your newly created file will tell you which of the installed and enabled plugins is creating the issue. In my case was a Google Analytics plugin which was causing a PHP Fatal Error (Call to undefined function) when loading the main page. Once the troble maker has been identified, simply remove it and everything should be back to normal.

3. The 3rd way of identifying a malfunctioning plugin is to upload a PHP file into your site root and access it via your browser. the PHP file (we will call it debug.php for the sake of this example), must contain the following code:

<?php
echo $a;
print_r(error_get_last());
?>

Once the file was uploaded to your root folder, access your site, you will get the same HTTP 500 – Internal Server Error. Ignore it and input into your browser address bar: “www.yoursite.com/debug.php“. The page will return last PHP encountered error.

That was more or less the whole story. Next, some things to keep in mind before upgrading your WordPress via automated upgrade tool:

  • Check the change log for the new version and ask your self: do I need the added features and bug fixes? Who knows…
  • Never upgrade in the same day of the new version release. Upgrading fast sounds tempting, but allow the plugin developers to also update their code to be compatible with the last WordPress version. Some are fast, some are lazy, some are in team building in Honduras…
  • Before automatic upgrade, check the plugins within your WordPress administration panel for any updated versions;
  • Backup your WordPress database. I use MySQL Administrator (part of MySQL GUI Tools). But every MySQL database administration plugins will do the job.
  • Backup your WordPress data files. I backup before every upgrade the whole root dir of the site and transfer it to a different drive.

Hope it helped. Happy upgrading :twisted: .

Share

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

15 responses so far

15 Responses to “Upgrading WordPress: Troubleshooting HTTP 500 – Internal Server Error”

  1. [...] more here: » Upgrading WordPress: Troubleshooting HTTP 500 – Internal Server …   WhatPriceUptimeDiskspaceBandwidthRatingsDetails Starts at $4.95 [...]

  2. [...] Read the rest here: » Upgrading WordPress: Troubleshooting HTTP 500 – Internal Server … [...]

  3. Zeton 20 Jul 2009 at 7:20 pm

    And if you get a “Service Unavailable” message when you try to access any page from your blog, be sure to delete the “.maintenance” file from your site root.

  4. Susanon 25 Jul 2009 at 5:02 pm

    I recently came across your blog and have been reading along. I thought I would leave my first comment. I don’t know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.

    Susan

    http://8080proxy.com

  5. Vampleon 14 Aug 2009 at 2:59 pm

    I came across the same problem. It turns out to be the incompatibility of the default theme with the new upgrade, so I overwrote the theme with another, which then works fine.

  6. PC Boosteron 24 Feb 2010 at 7:41 am

    can anybody tell me how to add google anylytic code on my wordpress blog as i did not found anywhere in blogs settings.

  7. Blog Copyright | Bell Phon PCon 19 Oct 2010 at 5:55 am

    [...] Upgrading WordPress: Troubleshooting HTTP 500 – Internal Server Error With the introduction of WordPress 2.7 upgrade capabilities for local installations are available right out of the box without the need of 3rd party plugins or manual update process. While this is cool, can also be a tricky, not so straight forward process. If your blog is hosted by WordPress,…… [...]

  8. [...] Upgrading WordPress: Troubleshooting HTTP 500 – Internal Server Error With the introduction of WordPress 2.7 upgrade capabilities for local installations are available right out of the box without the need of 3rd party plugins or manual update process. While this is cool, can also be a tricky, not so straight forward process. If your blog is hosted by WordPress,…… [...]

  9. reflib.orgon 24 Apr 2013 at 7:59 am

    I’m really enjoying the design and layout of your site. It’s a very easy on the eyes which makes it much more enjoyable for me to come here and
    visit more often. Did you hire out a developer to create your theme?
    Fantastic work!

  10. Jennieon 12 Jun 2013 at 12:26 am

    The true statement about belly fatWhat’s the topper leisurely solvent to receive categoric ab exercise abs. If your physical structure is leaner, more than up-and-coming, more than capable, more than balanced, and you’ve the
    low end of the grips. So if you have got existed depositting to an
    physical exercise quotidian and diet during the weekdays and and then let yourself eight-pack ab physical exercise
    symbolize more.

  11. instalator pozna&#324on 22 Jul 2013 at 4:51 pm

    Hello! This post could not be written any better! Reading through this post reminds me of
    my good old room mate! He always kept talking about this.
    I will forward this write-up to him. Pretty sure he will have
    a good read. Many thanks for sharing!

  12. growing grapeson 18 Oct 2013 at 2:25 am

    Sweet blog! I found it while surfing around on Yahoo News.
    Do you have any suggestions on how to get listed in Yahoo News?
    I’ve been trying for a while but I never seem to get there!
    Thank you

  13. Romaniaon 18 Oct 2013 at 8:30 am

    Hello to every body, it’s my first visit of this webpage; this blog
    includes amazing and really excellent data designed for visitors.

  14. jocuri noi bileon 22 Nov 2013 at 10:26 pm

    My little girl has explored the site and found lots of entertaining and educational activities to
    keep her busy when her toys are no longer interesting.
    Career choices are gender specific which
    means there are some task that is only limited with male and female players and characters.
    This is also a good option although not as good for participating in group quests and completing Dungeons.

    Here is my weblog; jocuri noi bile

  15. windows 8 add onson 11 Dec 2013 at 6:32 am

    - Modeгn eԁition capabilities from HTML5: It is the ‘in’ thing for web development
    & the evοlutionary invеntion ever iin development zone.
    Herе customers can enjoy the oyster bar, samplers, appetizerѕ, soups and saladѕ with the drinks of their choice.
    Exit tthe window when you’re done to return to your Windows 8 desktop.
    You’ll save even mοre ass energy costs continue tto rise.
    For modеrn іnterior decorаtiоn, lay tіles in
    dimensions of 2′ x 1′. Aѕ with anу application however,
    ІE8 has it’s own share of problems too.

Trackback URI | Comments RSS

Leave a Reply