XAMPP is a great way to get started with local development of your site – if you have a spare PC or laptop you can easily set up your webserver on the laptop and then develop from another PC over your Home Wifi network. In this article I will show you how to get it configured

1. Install XAMPP and open up the dashboard site (usually at localhost/xampp or localhost:8080/xampp)

2. Open up the PHPMyAdmin tool

3. Locate the WordPress table

4. On the Structure tab click on the Browse link for the table wp_options

Browse Wp Options Table.png

SQL Query To Change Localhost In Database Automatically

If you have a lot of localhost references in your database run this query via PHPMyAdmin

UPDATE wp_options SET option_value = replace(option_value, 'http://localhost/folder', 'http://chronos/folder'') WHERE option_name = 'home' OR option_name = 'siteurl';

(replace chronos with your own network name and folder with the folder where WordPress is installed!)

In some cases you may want to replace more than just “home” and “siteurl”, then drop the entire WHERE clause:

UPDATE wp_options SET option_value = replace(option_value, 'http://localhost/folder', 'http://chronos/folder'') ;

 

(replace chronos with your own network name and folder with the folder where WordPress is installed!)

Change Localhost For “Home” And “Siteurl” Manually

5. Change the very first entry “siteurl” by clicking the Edit button and replace localhost with your computer name e.g. in my case “chronos” – you can verify your computer name by opening the Windows explorer and entering \\computername – if your PC does not connect and your firewall is not blocking the connection then you need to double-check your actual network name. Keep in mind that the computer name and network name do not have to be identical

Change Localhost To Your Computer Name.png

6. Also replace any other entries that use the localhost to resolve the address e.g. row 36 “option home”:

Replace Other Localhost Entries.png

Accessing XAMPP Apache Webserver Over Home Network

7. Once done, try entering this computername/xampp into the address bar of your browser – if you’ve done everything correctly and you have XAMPP running on your other PC and you can access the PC via your network (open Windows explorer and click on Network to verify!) then you should now see the XAMPP dashboard

Example: http://chronos/xampp (in most browsers you do not have to enter a leading http)

8. Alright, we are done – right-click on your site and click “Source” to verify there are no links pointing to localhost – else you might have done something wrong above. I recommend

Additional SQL Queries You May Find Useful To Update Posts

 UPDATE wp_options SET option_value = replace(option_value, 'http://localhost/folder', 'http://chronos/folder') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://localhost/folder','http://chronos/folder');
UPDATE wp_posts SET post_content = replace(post_content, 'http://localhost/folder', 'http://chronos/folder');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://localhost/folder', 'http://chronos/folder');