Posted on Nov 27, 2009

WordPress: Fatal error: Allowed memory size of xxx bytes exhausted

This took me several hours of my time so I’m posting it for posterity. Like many people, I began getting these errors when loading my blog. In most cases, this indicates a memory leak in a plugin. I upped the memory limit in my wp-settings.php for a while but my blog became incredibly slow. I tried disabling plugins one by one, changing my theme, etc. I installed the wp-memory-usage plugin which led my nowhere. Finally, I figured I’d optimize my database and I found the wp-dbmanager plugin and noticed my wp_options table was 463 MB in size (compared to 900k for my wp_posts table).

It turns out I had over 1000 rows of cached rss lookups (select count(*) from wp_options where option_name like ‘rss%’). It is safe to delete these rows and it fixed the problem. I now have a working blog again.

Posted on Jul 9, 2009

WordPress upgrade destroyed my database

Trying to upgrade automatically from wordpress 2.8.0 to 2.8.1 just cost me a couple hours. I got the dreaded white screen of death after the upgrade. The process for trying to figure out WTF causes this sucks. Here’s what I tried for solutions:

  1. Move the wp-content/plugins directory in case there was a plugin incompatibility
  2. Disable the plugins in the database in case simply moving the directory wasn’t enough (update wp_options set option_value = ” where option_name = ‘active_plugins’;)
  3. Move my blog out of the way and reinstall from scratch – here the first page loaded as long as I didn’t update the default wp-config.php, after I updated it and pointed it to the proper database, I got the white screen again – PROGRESS
  4. Since it was obviously the database, I put my upgraded blog directory back and restored the db from backup. This worked, though I had to run upgrade.php to update the database for 2.8.1

Posted on Jun 26, 2008

WordPress changes

If you are one of the few people who subscribes to this blog you may have noticed all the duplicate posts today. This is due to my own idiocy. I screwed something up and had to restore from a backup (lost one week, but only a couple actual posts).

Also after upgrading to wordpress 2.5, I thought I’d convert all my categories to tags so I could have one of those bad-ass tag clouds. This was easy (from the wordpress admin menu):

Settings->Import->Convert Categories to Tags

This of course screwed up the Advanced Category Excluder as I now have no categories. Luckily, I found another plugin that does both categories and tags:

http://www.codehooligans.com/2008/04/27/simply-exclude-plugin/

This also affected my syndication, so I had to make edits to feedwordpress settings and change tags to categories.

Still to come – even though feedwordpress says it will create permalinks to the original article, they still point to this site. Thinking about disabling it, removing it from wp-content/plugins and removing all the rows associated with it in the wp_options table….

Posted on Oct 31, 2007

Resetting the WordPress ‘admin’ password

  1. Get an MD5 hash of your password.
    • Visit MD5 Hasher (http://epleweb.com/md5/), or…
    • Create a key with Python. or…
    • On Unix: echo -n <password> | md5sum
  2. “mysql -u root -p” (log in to MySQL)
  3. enter your mysql password
  4. “use (name-of-database)” (select WordPress database)
  5. “show tables;” (you’re looking for a table name with “users” at the end)
  6. “SELECT ID, user_login, user_pass FROM (name-of-table-you-found)” (this gives you an idea of what’s going on inside)
  7. “UPDATE (name-of-table-you-found) SET user_pass=”(MD5-string-you-made)” WHERE ID = (id#-of-account-you-are-reseting-password-for)” (actually changes the password)
  8. “SELECT ID, user_login, user_pass FROM (name-of-table-you-found)” (confirm that it was changed)
  9. (type Control-D, to exit mysql client)

Note if you have a recent version of MySQL (version 5.x?) you can have MySQL compute the MD5 hash for you.

  1. Skip step 1. above.
  2. Do the following for step 7. instead.
    • “UPDATE (name-of-table-you-found) SET user_pass = MD5(‘”(new-password)”‘) WHERE ID = (id#-of-account-you-are-reseting-password-for)” (actually changes the password)