How to debug problems on wordpress migrations
25 Feb 2015I migrated my blog from one server to another, and was seeing the usual white-screen-of-death on the http://blog.wordpress.com/wp-admin
page. I tried enabling debugging with
[code lang=php]
define('WP_DEBUG', true);
[/code]
in the wp-config.php
file. But this does not work on some webservers if some option (that I dont remember) is not enabled. So instead, I used the poor man's debugger: the print
statement.
So I went into the wordpress/wp-admin
directory, and started with the index.php
file. I inserted
[code lang=php]
print('hello world');
[/code]
statements after each line, and then I'd reload the http://blog.wordpress.com/wp-admin
page and see if the print statement executed. If it did, I moved the print statement further down the file to see what failed. I was able to finally trace this to a statement of the form
[code lang=php]
requireonce(dirname(dirname(__FILE__)). '/wp-load.php');
[/code]
which was not working as intended. The dirname(dirname(__FILE__))
statement is supposed to ascend to the parent of the directory of the current file. This was not working as intended. I just changed this to
[code lang=php]
requireonce('../wp-load.php');
[/code]
My dashboard started working again after I made this change!