Testing Wordpress in Windows From a Mac
I work on a Mac but I need to be able to test my sites on a Windows computer, namely because I need to make sure the 40% or so people who are using IE won’t have the site break on their crappy browser. Since I work on localhost (my local machine), I could upload my site to a remote server and test it on another computer running Windows. This is slow, and I want to test it on the same machine so that changes appear instantly. The solution:
- Install Windows in a virtual machine on your Mac (Parallels, VMWare Fusion or the brilliant, free, fast and multi-OS VirtualBox)
- Export your Wordpress database from phpMySQL. Make a backup of the `.sql` file.
- Open your text editor (BBEdit, Textmate, Espresso, TextEdit (pre-installed)) and replace all occurrences of your localhost URL with your local IP address. For example, `http://localhost/mysite` becomes `http://192.168.0.2/mysite`. Notice the lack of a trailing forward-slash!
- Drop/Delete all tables in your database in phpMySQL and upload the modified `.sql` file.
- Now in your Virtual Machine on Windows, enable a shared network with the host (your Mac)
- Access `http://192.168.0.2/mysite` on your Mac and in the Windows Virtual Machine