Blog Entries tagged wordpress
Feeds: RSS | Atom

Upgrading Wordpress from 2.0.6 -> 2.5 - not a smooth experience

Published: 2008-05-13 18:40 UTC. Tags: software wordpress

My girlfriend runs a wordpress-powered blog. Yesterday, she decided to upgrade it from 2.0.6 to 2.5. A good decision given the fact that the old version had a known security vulnerability.

Most of the upgrade went fine, but it left her with a mysterious trouble - blog entries, links etc. could all be edited, but trying to edit existing and published pages rendered an error message, "You are not allowed to edit this page."

After some serious head-scratching, I found this post that led to this forum post, that gave a rather mysterious hint on what needed to be done to fix the problem. It turns out that the upgrade had failed to update the row with option_name = wp_user_roles in the wp_options table.

So, the following SQL statement fixed the problem for me:

UPDATE wp_options set option_value = 'a:5:{s:13:"administrator";a:2:{s:4:"name";s:13:"Administrator";s:12:"capabilities";a:47:{s:13:"switch_themes";b:1;s:11:"edit_themes";b:1;s:16:"activate_plugins";b:1;s:12:"edit_plugins";b:1;s:10:"edit_users";b:1;s:10:"edit_files";b:1;s:14:"manage_options";b:1;s:17:"moderate_comments";b:1;s:17:"manage_categories";b:1;s:12:"manage_links";b:1;s:12:"upload_files";b:1;s:6:"import";b:1;s:15:"unfiltered_html";b:1;s:10:"edit_posts";b:1;s:17:"edit_others_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:10:"edit_pages";b:1;s:4:"read";b:1;s:8:"level_10";b:1;s:7:"level_9";b:1;s:7:"level_8";b:1;s:7:"level_7";b:1;s:7:"level_6";b:1;s:7:"level_5";b:1;s:7:"level_4";b:1;s:7:"level_3";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:17:"edit_others_pages";b:1;s:20:"edit_published_pages";b:1;s:13:"publish_pages";b:1;s:12:"delete_pages";b:1;s:19:"delete_others_pages";b:1;s:22:"delete_published_pages";b:1;s:12:"delete_posts";b:1;s:19:"delete_others_posts";b:1;s:22:"delete_published_posts";b:1;s:20:"delete_private_posts";b:1;s:18:"edit_private_posts";b:1;s:18:"read_private_posts";b:1;s:20:"delete_private_pages";b:1;s:18:"edit_private_pages";b:1;s:18:"read_private_pages";b:1;s:12:"delete_users";b:1;s:12:"create_users";b:1;}}s:6:"editor";a:2:{s:4:"name";s:6:"Editor";s:12:"capabilities";a:34:{s:17:"moderate_comments";b:1;s:17:"manage_categories";b:1;s:12:"manage_links";b:1;s:12:"upload_files";b:1;s:15:"unfiltered_html";b:1;s:10:"edit_posts";b:1;s:17:"edit_others_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:10:"edit_pages";b:1;s:4:"read";b:1;s:7:"level_7";b:1;s:7:"level_6";b:1;s:7:"level_5";b:1;s:7:"level_4";b:1;s:7:"level_3";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:17:"edit_others_pages";b:1;s:20:"edit_published_pages";b:1;s:13:"publish_pages";b:1;s:12:"delete_pages";b:1;s:19:"delete_others_pages";b:1;s:22:"delete_published_pages";b:1;s:12:"delete_posts";b:1;s:19:"delete_others_posts";b:1;s:22:"delete_published_posts";b:1;s:20:"delete_private_posts";b:1;s:18:"edit_private_posts";b:1;s:18:"read_private_posts";b:1;s:20:"delete_private_pages";b:1;s:18:"edit_private_pages";b:1;s:18:"read_private_pages";b:1;}}s:6:"author";a:2:{s:4:"name";s:6:"Author";s:12:"capabilities";a:10:{s:12:"upload_files";b:1;s:10:"edit_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:4:"read";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:12:"delete_posts";b:1;s:22:"delete_published_posts";b:1;}}s:11:"contributor";a:2:{s:4:"name";s:11:"Contributor";s:12:"capabilities";a:5:{s:10:"edit_posts";b:1;s:4:"read";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:12:"delete_posts";b:1;}}s:10:"subscriber";a:2:{s:4:"name";s:10:"Subscriber";s:12:"capabilities";a:2:{s:4:"read";b:1;s:7:"level_0";b:1;}}}' where option_name = 'wp_user_roles';

Your mileage may vary. Don't do this at home if you don't know what you're doing, kids.

Now I'll have to go and do something about a serious itch on my left leg caused by having to read so much PHP code.

0 comments.

Running Wordpress on one.com accounts

Published: 2007-01-14 12:56 UTC. Tags: software wordpress

My girlfriend has a hosting account at one.com for her domain (number of .se-domains owned by the two people in this household: Three). Until now, she has been running static html pages generated by Dreamweaver, but a month or so ago, she decided she wanted to go for Wordpress.

As she has a background as a PC technician and a good understanding of how computers work in general, and also because Wordpress is really easy to install, she managed to install and get working with Wordpress without much help. It did not work 100%, though. The file upload dialog was not working, instead displaying an error message from Apache, and after many common administrative operatings, the same apache error message was displayed, and you had to manually navigate to a known URL to get back into the interface.


After some analysis using Wireshark, I came to the conclusion that for some reason, the Apache servers at one.com didn't let PHP scripts set the Location header when trying to do redirects with HTTP response code 302 (temporary relocation). Weird.

The solution was to enable support for my-hacks.php (can be done via the administrative interface), and add a my-hacks.php to the root directory of the wordpress installation with the following contents:

<?php
$is_IIS = 1;
?>

This causes wordpress to use an alternative strategy for doing redirects, which works better with the Apache servers at one.com.

The fact that one.com has turned off the regular expression support in mod_rewrite did by the way not help when writing rules to make sure old links redirect to the new url scheme used by wordpress.
0 comments.