4
Jul/09
7

“You do not have sufficient permissions to access this page” after Wordpress upgrade

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 4.50 out of 5)
Loading ... Loading ...

If you’ve done a wordpress upgrade which included either copying another wp database or changing the current one’s table prefix (as well as changing the $table_prefix PHP variable in your config file,) you will most likely be met with this warning when you try to log in:

You do not have sufficient permissions to access this page.

The reason for this is that everything in wordpress that accesses info in the db does so from PHP using the $table_prefix variable, and when you first installed your blog, a couple of options are set in the database that include that value, which makes it not really so dynamic! ;)

After rooting through my db, I found 5 or 6 values that still had the old table prefix in – mostly in the `usermeta` table, but also one in the `options` table. To make sure I got them all, I ran these simple SQL statements in phpMyAdmin to update all the values:

UPDATE `wp2_usermeta` SET `meta_key` = REPLACE(`meta_key`, 'wp_', 'wp2_');
UPDATE `wp2_options` SET `option_name` = REPLACE(`option_name`, 'wp_', 'wp2_');

(note: please be sure to backup your database before you execute any SQL on it – if something goes wrong, there’s not a lot you can do to recover it without a backup!)

In those two examples, assume the original prefix was “wp” and the new one is “wp2″.

With that done, I can now log in to my newly upgraded blog again! :)

4
Jul/09
5

Wordpress 2.8 automatic upgrade fails

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 4.50 out of 5)
Loading ... Loading ...

I’ve been trying to update my wordpress blogs from various versions like 2.5 and 2.7 to the newest 2.8 for a while now, but was never able to do it automatically.

Every time I pressed the “upgrade automatically” button, it told me it was downloading the latest file from Wordpress, but it never got any further than that. I logged in to my site using my FTP client and found a 0KB sized file called wordpress2.8.zip in the wp_content folder, so I thought I’d found the issue – maybe the script can’t actually download the file and save it to disk because of permissions. I chmodded the file and then the folder to allow write access, but no joy.

Of course, I could have just downloaded the latest install from wordpress and done a manual upgrade, but there’s about 8 million files in the zip file and I didn’t want to have to upload that to 5 different sites! ;)

After a bit of research, it turns out that the problem is that the auto-upgrade script requires PHP5 to run, and as my sites are hosted on 1and1 servers which default to php4, the script was failing!

So if you’re having the same issue, all you need to do is make sure your wordpress is running on PHP5 instead of 4! If you’re on a shared server and you can’t change the server’s config, you can still tell apache to run your scripts as PHP5 rather than 4 by adding the following line to your .htaccess:

AddType x-mapp-php5 .php

All that does is tells apache to to parse all .php files with the PHP5 parser rather than whatever the server’s default is! So just throw that in the .htaccess you find in the root of your site – put it just after the “# END WordPress” line – save it, upload it and try doing the upgrade again – it worked first time for me! :)

If you’re still having trouble after that, or you’ve got a different solution, please post a comment here and let others know!

26
Apr/09
1

The JavaScript Programming Language

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 4.00 out of 5)
Loading ... Loading ...

Someone posted these links in a resources thread in one of the programming forums I contribute to.

It’s basically a presentation by Yahoo! JavaScript Architect Douglas Crockford – it’s a couple of years old, but it’s all still pretty much accurate.

It’s a must-see for anyone who doesn’t know much about JavaScript, or more importantly, anyone who thinks they know about it and has cast it aside as a “simple scripting language”. ;)

It’s about 2 hours long so it’s a bit of an investment, but it’s been broken up into 4 half-hour-ish videos for your viewing pleasure.

Enjoy:

Part 1, Part 2, Part 3 and Part 4

21
Apr/09
1

Apple iPhone OS 3.0 – function follows form

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)
Loading ... Loading ...

I was reading a post over at ALA today called In Defense of Eye Candy, in which Stephen Anderson talks about how actually putting some effort into the way a site looks can have positive effects on the way the site is used.

The more we learn about people, and how our brains process information, the more we learn the truth of that phrase: form and function aren’t separate items. If we believe that style somehow exists independent of functionality, that we can treat aesthetics and function as two separate pieces, then we ignore the evidence that beauty is much more than decoration. Our brains can’t help but agree.

Just 5 minutes after I read the article I opened up Safari to test one of our sites in, and saw a great big shiny blue button advertising the upcoming iPhone OS 3.0 software on the apple startpage.

Ok, yes, the graphics are quite cool, but what drew my attention was the list of new features Apple will be adding to the iPhone/iPod Touch, including:

* Search your iPhone
* Cut, copy, and paste
* Send photos, contacts, audio files, and location via MMS*
* Read and compose email and text messages in landscape

Apparently, “For iPhone owners, it just keeps getting better” – that’s right – it’s getting so much better that after a year and a half, iPhone users will finally be able to do things other phones/PDAs have been already been doing for years! :D

kthnxbai_thumb

I’m thinking someone at Apple should read Anderson’s articles and get them to spend a little less time faffing around with flashy graphics, and a little more time on functionality…

Come on Apple, sort it aaaaht.

Healthspark