Local WordPress shows empty page

I thought it’ll be easy to pull my WP site down to local and make some theme changes. Just install XAMPPLite, export/import my database, backup the site files and go.

It kept showing an empty site, with no errors reported in the log, so I ended up tracing through the code to find out the what was not working. Below were the other changes I had to make.

The siteurl and home attributes in the wp_options table of the database had to be updated. I opted to change it in wp-config.ini using the following 2 lines:

define('WP_HOME', 'http://localhost/wp' );
define('WP_SITEURL', 'http://localhost/wp');

I realize some PHP was not parsed when the shorter tag is used. This option needs to be explicitly enabled in php.ini.

short_open_tag = On

The OpenID plugin requires the GMP extension, which needs to be enabled in php.ini. The comments on the PHP documentation site helped.


Eclipse Remote Debugging

Eclipse has a powerful debugger, which allow breakpoints, code stepping, variable inspection, expressions, hot code replacement etc. Therefore any application that is run from Eclipse can be debugged.

Even if it is a built and released application running on a separate machine, it can also be debugged remotely from an Eclipse IDE. As this option is built into the JVM, it can work on any kind of Java application; from simple Java applications to web applications to complex Eclipse RCP plugins.

Just add these JVM options to the command that starts the application/web server.

-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=1234

When the application is started, it will wait for a debugger to be attached.

From Eclipse, Open the Debug dialog, and create a new “Remote Java Application”. Set the host and port in the “Connection Properties” section to the waiting application. Click “Debug” and watch it go! Set the breakpoints and it can be debugged as if it was locally run.