Wordpress Upgrade Error on Debian/Ubuntu
A quick guide to responding to a fairly obscure WP error encountered during an upgrade/migration.
Saturday, 2010-02-06 | On the Internet, Programming
| "Actually, he's usually just in there with some Bibb lettuce and a handful of Rubino beets." |
| Chris Onstad |
While migrating some WordPress blogs from a Debian to a Ubuntu server, I hit a tiny snag that cost me 15 minutes or so.
After I copied all the files to /usr/share/wordpress/wp-content, I created symlinks in /etc/wordpress to the config-* files in the /usr/share/wordpress doc root, restored the databases, replaced the Apache config files and tried to fire up the sites, I got this error:
The config file for the specified host is not under an allowed path
$allowed_paths = array('/etc/wordpress'); if (!in_array(dirname(realpath($debian_file)), $allowed_paths)) die("The config file for the specified host is not under an allowed path");
As you'll recall, I mentioned at the start of the article that I created symlinks in /etc/wordpress to the config-* files that I had been maintaining in /usr/share/wordpress. So, in order to get things working again, I had to dump the symlinks:
root@lana:/etc/wordpress# ls -la total 16 drwxr-xr-x 2 root root 4096 2010-02-06 15:43 . drwxr-xr-x 99 root root 4096 2010-02-06 14:06 .. lrwxrwxrwx 1 root root 46 2010-02-06 15:40 config-rustypipes.org.php -> /usr/share/wordpress/config-rustypipes.org.php lrwxrwxrwx 1 root root 53 2010-02-06 15:40 config-sweetheartbrigade.com.php -> /usr/share/wordpress/config-sweetheartbrigade.com.php lrwxrwxrwx 1 root root 54 2010-02-06 15:40 config-zombiesatemyashley.com.php -> /usr/share/wordpress/config-zombiesatemyashley.com.php -rw-r--r-- 1 root www-data 194 2009-08-24 11:23 htaccess -rw-r--r-- 1 root www-data 932 2009-08-24 11:23 wp-config.php root@lana:/etc/wordpress# rm config-*
root@lana:/usr/share/wordpress# mv /usr/share/wordpress/config-* /etc/wordpress/.
