Everybody Staze...

Nobody leavz...

  • Home
  • About Me
    • LinkedIn
    • Lab
  • Contact
  • Links
  • Reviews
  • Sitemap
  • Weather
You are here: Home / Archives for Wordpress

Moving wordpress tables

2009/08/22 By staze

This also applies to renaming table prefixes within the same database.

Previously on my server, I had 3 databases that I used actively. One for this website, one for another, and one for my power/gas data. The two websites are both wordpress.

So, just a few moments ago, I consolidated those tables into one database. I had to change the table prefix for one of the sites so both sites tables could coexist within the same database (and not have collisions). After changing the wp-config.php to reflect this change, the site loaded up. The problem is, I tried to go into the admin page, and I get “You do not have sufficient permissions to access this page”.

A lot of the info on the wordpress site doesn’t really cover this issue. Luckly, this does. Basically, you need to go into the “usermeta” table, and change the “meta_key” values from the previous prefix_capabilities, and prefix_user_level, to the new prefix_capabilities and new prefix_user_level. Then go into the options table and change prefix_user_roles to the new prefix_user_roles.

Once that’s done, things should work. You can certainly use the SQL statements he has on his site, but I had a hard time following what he was saying. So, I did it by hand once I figured it out.

Thanks very much, and hopefully I’ll have more later tonight or tomorrow.

(p.s. Sorry about the quality of the camera image. I’m working on it…)

Filed Under: Coding Tagged With: moving tables, MySQL, Wordpress

.htaccess password annoyance…

2009/06/14 By staze

So, this is mainly a note to myself, but…

Been having some issues password protecting a folder on the work server, and finally figured out the issue.

Had a valid .htaccess file in the folder, and an .htpassword that was accessible. Yet I kept getting 404 errors. Thanks to the popularity of wordpress (even though we don’t use it at work), I found the answer.

Apparently, apache needs to be able to find a 401 error file in order to trigger a login prompt. So, adding ErrorDocument 401 401.html then creating a 401.html in the protected folder, with anything at all in it, suddenly made it work.

Gar…

Filed Under: Sys Admin, Work Tagged With: .htaccess, Wordpress

Automatic plugin updates

2009/06/07 By staze

Just thought I’d add to the world’s collective knowledge by posting this tidbit…

I’ve been wresting with trying to get wordpress’s automatic plugin update to work for the past hour or two, and just figured out what was going on.

First, I had to install the SSH2 plugin for php. Info on that can easily be found via google. Once you have that installed, and the php.ini changed to load the plugin, restart the webserver and make sure it’s loaded (phpinfo()).

Okay, so, once that was done, I saw the SSH option for the autoupdate. Looking around, people said to use “localhost” as the hostname, since the connection seems to be initiated from the webserver. I guess this field really only matters if you have a separate ftp/sftp server than the webserver.

So, next hurdle is to create a user that has it’s “home directory” or “root” set to the wordpress install directory. Since I’m hosting on a Mac, this is /Library/WebServer/Documents/staze.org/. So, now, things should work, right?

Nope. Kept getting “unable to locate wordpress plugin directory”. As it turns out, most inaccurate error message ever. I tested again and again with various settings, and all I kept getting was “unable to locate wordpress plugin directory”.

So, turns out, apache (or php maybe?) doesn’t like ACLs. I previously had the web directory owned by an admin user, with www as the group, then ACLs set for the www user. No good. Once I chowned everything over to the prevebial “www:www”, things immediately worked.

So really, the error message should have been saying “unable to write to plugins directory” or something like that.

*sigh*

Going to create another post for the other things going on…

Filed Under: Sys Admin Tagged With: automatic update, plugin, Wordpress

« Previous Page
Next Page »

Weather

Categories / Archives

  • Apple
  • Coding
  • Electronics
  • Energy
  • Home Ownership
  • Miscellany
  • Politics
  • Prius
  • Sys Admin
  • Travel
  • Uncategorized
  • Work
  • June 2026
  • April 2026
  • August 2025
  • April 2025
  • January 2024
  • February 2021
  • July 2020
  • January 2020
  • April 2019
  • March 2018
  • February 2018
  • June 2017

Copyright © 2026 · Staze On Genesis Framework · WordPress · Log in