Yesterday, I installed WordPress on Windows/XAMPP. I rarely use native Windows for developing PHP projects, but recently, I have to use some Windows app during development so I install XAMPP for quick up and running because WSL2 isn't stable yet.
Everything works well, until I access wp-admin, I immediately got a big error message that I never met in Linux:
I always turn on debug and error reporting, so this message obviously doesn't help me anything.
I've checked rewrite rules, log files, .htaccess
, wp-config.php
but this doesn't help. I got frustrated.
Checking these things doesn't helps, WP seems doesn't provide any useful message. I've checked the database, my table prefix is exactly same as wp-config
file. My frontend works fine, until I logged in as admin, so I think the problem is the user permissions. But why?
I have checked the wp_usermeta
but didn't noticed that they use table prefix for their meta field, and you know what? MySQL have a config that makes table names always lowercase. That was enabled by default in XAMPP.
lower_case_table_names = 1
Our database table names was lowercased but meta data weren't, so the code can't check for right permissions. I blame WP for that. It isn't necessary to put table prefix in meta key. That makes things harder, even when we need to change table prefix also.
I change the table prefix to match case with meta data and everything works fine. For future, please always use lowercase for table prefix in WordPress.