{"id":9376,"date":"2018-05-21T13:52:12","date_gmt":"2018-05-21T13:52:12","guid":{"rendered":"https:\/\/www.hostinger.com\/tutorials\/?p=9376"},"modified":"2025-04-25T17:27:58","modified_gmt":"2025-04-25T17:27:58","slug":"how-to-use-xampp-wordpress","status":"publish","type":"post","link":"\/uk\/tutorials\/how-to-use-xampp-wordpress","title":{"rendered":"How to Use XAMPP: A 3-Step Guide to Setting Up a Local WordPress Site"},"content":{"rendered":"<p>Setting up a locally-hosted environment is a crucial step in any WordPress development project. Doing this enables you to safely test your site&rsquo;s features and functionality, on a site that&rsquo;s completely private.<\/p><p>In this article, we&rsquo;ll explore how to use&nbsp;XAMPP to set up a local web server for developing and testing your WordPress site. This involves three steps:<\/p><ol class=\"wp-block-list\">\n<li>Install XAMPP.<\/li>\n\n\n\n<li>Run XAMPP and configure your environment.<\/li>\n\n\n\n<li>Download and run WordPress.<\/li>\n<\/ol><p>We&rsquo;ll also discuss some best practices for experimenting with code and testing WordPress using XAMPP. Finally, we&rsquo;ll cover how to use XAMPP with a WordPress multisite installation.<\/p><p class=\"has-text-align-center\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/Mega-WordPress-Cheat-EN.pdf\" target=\"_blank\" rel=\"noopener\">Download all in one WordPress cheat sheet<\/a><\/p><p>\n\n\n\n\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-why-you-might-need-a-local-wordpress-site\">Why You Might Need a Local WordPress Site<\/h2><p>A locally-hosted WordPress site is one that is only accessible by people on your network (that is, there are no live components). As such, this type of site can serve as a <a href=\"\/uk\/tutorials\/wordpress-staging-environment\">safe environment<\/a>, in which new features and troubleshooting methods can be tested.<\/p><p>Local websites are perfect for performing the following types of tasks:<\/p><ul class=\"wp-block-list\">\n<li><strong>Creating new themes and plugins:<\/strong>&nbsp;When using a local site, you don&rsquo;t need to worry about any of the issues you might encounter when developing on a live WordPress site.<\/li>\n\n\n\n<li><strong>Website staging: <\/strong>You can create a copy of a live website, which can then be used for testing purposes.<\/li>\n\n\n\n<li><strong>Site debugging and troubleshooting: <\/strong>Working under the hood of your live site in order to resolve bugs or other issues may lead to bigger problems (and, potentially, costly downtime). By creating a local WordPress site, you can try out various solutions, and easily restore previous versions of your site should you make any mistakes.&nbsp;&nbsp;&nbsp;&nbsp;<strong>&nbsp;<\/strong><\/li>\n<\/ul><p>For these reasons, creating a locally-hosted WordPress site is highly recommended for just about any development project. First, however, you&rsquo;ll need a tool that will make the process of setting up a locally-hosted site quick and easy.<\/p><h2 class=\"wp-block-heading\" id=\"h-an-introduction-to-xampp\">An Introduction to XAMPP<\/h2><p>A few crucial ingredients are needed if you want to <a href=\"\/uk\/tutorials\/install-wordpress-locally\">install WordPress locally<\/a>. These consist of web server software (such as <a href=\"https:\/\/httpd.apache.org\/\" target=\"_blank\" rel=\"noopener\">Apache<\/a>), programming languages like&nbsp;<a href=\"https:\/\/www.perl.org\/\" target=\"_blank\" rel=\"noopener\">Perl<\/a> and&nbsp;<a href=\"http:\/\/www.php.net\/\" target=\"_blank\" rel=\"noopener\">PHP<\/a>, and the database management software &ndash;&nbsp;<a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/what-is-mysql.html\" target=\"_blank\" rel=\"noopener\">MySQL<\/a>. Installing each of these elements separately, however, is time-consuming and difficult.<\/p><p><a href=\"https:\/\/www.apachefriends.org\/index.html\" target=\"_blank\" rel=\"noopener\">XAMPP<\/a> (an acronym for cross (x)-platform, Apache, MySQL, PHP, and Perl) enables you to install all these elements quickly and easily. You can then use XAMPP to set up the environment required to run WordPress on a local machine. There, you can test plugins, experiment with themes and coding, and carry out other development activities safely.<\/p><p>XAMPP is free and open-source software, backed-up by a sizable <a href=\"https:\/\/www.apachefriends.org\/community.html\" target=\"_blank\" rel=\"noopener\">support community<\/a>. It&rsquo;s also extremely lightweight, and all the elements required to set up a local web server are contained within a single extractable file. What&rsquo;s more, learning how to use XAMPP is relatively straightforward, as we&rsquo;ll discuss in the following XAMPP tutorial.<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-use-xampp-to-set-up-a-local-wordpress-site-in-3-steps\">How to Use XAMPP to Set Up a Local WordPress Site (In 3 Steps)<\/h2><p>In the following steps, we&rsquo;ll walk you through how to use XAMPP and <a href=\"\/uk\/tutorials\/how-to-install-wordpress\">install WordPress<\/a> on it. For this tutorial, we will be covering the steps for the Mac version of the software. However, XAMPP can also be set up and run relatively easily on both <a href=\"https:\/\/www.apachefriends.org\/faq_windows.html\" target=\"_blank\" rel=\"noopener\">Windows<\/a> and <a href=\"https:\/\/www.apachefriends.org\/faq_linux.html\" target=\"_blank\" rel=\"noopener\">Linux<\/a> devices, using a similar process.<\/p><h3 class=\"wp-block-heading\" id=\"h-step-1-install-xampp\">Step 1: Install XAMPP<\/h3><p>First of all, you&rsquo;ll need to go to the <a href=\"https:\/\/www.apachefriends.org\/index.html\" target=\"_blank\" rel=\"noopener\">Apache Friends website<\/a>, and select the relevant download link on the homepage:<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/02\/download-xampp-page-1.png\"><img decoding=\"async\" width=\"1024\" height=\"513\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/02\/download-xampp-page-1-1024x513.png\" alt=\"Download XAMPP page\" class=\"wp-image-78703\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/02\/download-xampp-page-1.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/02\/download-xampp-page-1-300x150.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/02\/download-xampp-page-1-150x75.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/02\/download-xampp-page-1-768x385.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><p>Next, drag XAMPP into your <strong>Applications<\/strong> folder:<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1024\" height=\"415\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2018\/05\/XAMPP-drag-to-Applications-Folder.jpg\" alt=\"XAMPP drag to Applications Folder\" class=\"wp-image-9390\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/XAMPP-drag-to-Applications-Folder.jpg 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/XAMPP-drag-to-Applications-Folder-150x61.jpg 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/XAMPP-drag-to-Applications-Folder-300x122.jpg 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/XAMPP-drag-to-Applications-Folder-768x311.jpg 768w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/XAMPP-drag-to-Applications-Folder-990x401.jpg 990w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/XAMPP-drag-to-Applications-Folder-1320x535.jpg 1320w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div><p>Once the initial loading sequence is completed, XAMPP will be installed on your system. This part of the setup process doesn&rsquo;t require much on your end.<\/p><p>It should be mentioned that if you are running XAMPP on Windows, and another program on your machine is using ports 80 or 443, you may encounter a port error. For example, the World Wide Web Publishing Service program commonly uses port 80 and may cause a conflict with XAMPP.<\/p><p>To resolve this, you&rsquo;ll need to stop that service from running by doing the following things:<\/p><ol class=\"wp-block-list\">\n<li>Navigate to the Windows <strong>Start<\/strong> menu, and type in <strong>services.msc<\/strong>.<\/li>\n\n\n\n<li>In the <strong>Services<\/strong> window, locate World Wide Web Publishing Service.<\/li>\n\n\n\n<li>Right click on it, and select the <strong>Stop<\/strong> button.<\/li>\n\n\n\n<li>Restart XAMPP. The port error will be resolved if&nbsp;World Wide Web Publishing Service was the culprit.<\/li>\n<\/ol><p>If this doesn&rsquo;t resolve the issue, it may be caused by your Windows firewall. To forcibly unlock your ports, you will need to set up a new firewall rule:<\/p><ol class=\"wp-block-list\">\n<li>Open up <strong>Windows Firewall<\/strong>&nbsp;and navigate to <strong>Advanced Settings<\/strong>.<\/li>\n\n\n\n<li>Go to <strong>Inbound<\/strong> &gt; <strong>New Rule<\/strong>.<\/li>\n\n\n\n<li>Go to <strong>Port<\/strong> &gt; <strong>TCP<\/strong>. You&rsquo;ll have to type <strong>80,443<\/strong> in the field labelled&nbsp;<strong>Specific Ports<\/strong>, then click on&nbsp;<strong>Next<\/strong>.<\/li>\n\n\n\n<li>Select <strong>Allow the Connection<\/strong>, then click on&nbsp;<strong>Next<\/strong> again.<\/li>\n\n\n\n<li>Make sure all listed options are checked and continue to the next page.<\/li>\n\n\n\n<li>In the <strong>Name<\/strong> field, type in a memorable name (such as <strong>host1<\/strong>) and select <strong>Finish<\/strong>.<\/li>\n\n\n\n<li>You&rsquo;ll now need to repeat steps 1 to 6, changing the name again (i.e. to&nbsp;<strong>host2<\/strong>) to clear the port.<\/li>\n\n\n\n<li>Restart your computer. Ports 80 and 443 should now be unblocked and open locally.<\/li>\n<\/ol><p>Once XAMPP is installed, you&rsquo;ll be all set to start running XAMPP.<\/p><h3 class=\"wp-block-heading\" id=\"h-step-2-run-xampp-and-configure-your-environment\">Step 2: <b>Run XAMPP and Configure Your Environment<\/b><\/h3><p>Now, open up the XAMPP application and hit the <strong>Start<\/strong> button. You should see a green light in the upper right-hand corner of the display:<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1024\" height=\"428\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2018\/05\/XAMPP-Start-Button-Screenshot.jpg\" alt=\"XAMPP Start Button Screenshot\" class=\"wp-image-9392\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/XAMPP-Start-Button-Screenshot.jpg 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/XAMPP-Start-Button-Screenshot-150x63.jpg 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/XAMPP-Start-Button-Screenshot-300x126.jpg 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/XAMPP-Start-Button-Screenshot-768x321.jpg 768w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/XAMPP-Start-Button-Screenshot-990x414.jpg 990w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/XAMPP-Start-Button-Screenshot-1320x552.jpg 1320w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div><p>Next, navigate to the&nbsp;<strong>Services <\/strong>tab. You will need to ensure that the status of both the Apache and MySQL stack services are running (i.e. that they have a green light). This will ensure that your database management and server software elements are in place for your local environment. For now, you can ignore ProFTPD&nbsp;(which is a configurable File Transfer Protocol server).<\/p><p>If MySQL or Apache are not running (if they display a red light), simply select them and hit <strong>Start<\/strong>:<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1024\" height=\"421\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2018\/05\/XAMPP-Services-Menu.jpg\" alt=\"XAMPP Services Menu\" class=\"wp-image-9393\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/XAMPP-Services-Menu.jpg 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/XAMPP-Services-Menu-150x62.jpg 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/XAMPP-Services-Menu-300x123.jpg 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/XAMPP-Services-Menu-768x315.jpg 768w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/XAMPP-Services-Menu-990x407.jpg 990w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/XAMPP-Services-Menu-1320x542.jpg 1320w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div><p>Then, switch over to the <strong>Network<\/strong> tab. Here, you can define the port forwarding rules between your host machine and your stack. Select the localhost option you wish to work on, and then hit the <strong>Enable<\/strong> button. In this example, we will be using <strong>localhost:8080<\/strong>:<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1024\" height=\"414\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2018\/05\/XAMPP-Network-Tab-Screenshot.jpg\" alt=\"XAMPP Network Tab Screenshot\" class=\"wp-image-9394\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/XAMPP-Network-Tab-Screenshot.jpg 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/XAMPP-Network-Tab-Screenshot-150x61.jpg 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/XAMPP-Network-Tab-Screenshot-300x121.jpg 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/XAMPP-Network-Tab-Screenshot-768x310.jpg 768w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/XAMPP-Network-Tab-Screenshot-990x400.jpg 990w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/XAMPP-Network-Tab-Screenshot-1320x534.jpg 1320w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div><p>You will now be able to <a href=\"\/uk\/tutorials\/what-is-localhost\">access your localhost<\/a>, and start using XAMPP as a server environment. To do this, open up your preferred web browser, and type in your localhost name (which in our case would be <strong>localhost:8080<\/strong>). This will bring up the XAMPP dashboard. Once there, select the <strong>phpMyAdmin<\/strong> button in the top right-hand corner of the page:<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/02\/XAMPP-Dashboard-phpMyAdmin-Button.png\"><img decoding=\"async\" width=\"1024\" height=\"204\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/02\/XAMPP-Dashboard-phpMyAdmin-Button-1024x204.png\" alt=\"XAMPP Dashboard phpMyAdmin Button\" class=\"wp-image-78704\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/02\/XAMPP-Dashboard-phpMyAdmin-Button.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/02\/XAMPP-Dashboard-phpMyAdmin-Button-300x60.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/02\/XAMPP-Dashboard-phpMyAdmin-Button-150x30.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/02\/XAMPP-Dashboard-phpMyAdmin-Button-768x153.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><p>You&rsquo;ll then need to create a database for your WordPress installation. To do this, select the <strong>Database<\/strong> tab, type in a name for your database (in our case, we&rsquo;ll simply go with <strong>WordPress<\/strong>), ensure the next drop-down menu is set to <strong>Collation<\/strong>, and then hit <strong>Create:<\/strong><\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1024\" height=\"211\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2018\/05\/phpMyAdmin-Database-Tab.jpg\" alt=\"phpMyAdmin Database Tab\" class=\"wp-image-9402\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/phpMyAdmin-Database-Tab.jpg 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/phpMyAdmin-Database-Tab-150x31.jpg 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/phpMyAdmin-Database-Tab-300x62.jpg 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/phpMyAdmin-Database-Tab-768x158.jpg 768w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/phpMyAdmin-Database-Tab-990x204.jpg 990w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/phpMyAdmin-Database-Tab-1320x272.jpg 1320w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div><p>After that, you&rsquo;ll be ready to learn how to install WordPress on XAMPP.<\/p><h3 class=\"wp-block-heading\" id=\"h-step-3-download-and-run-wordpress\">Step 3: Download and Run WordPress<\/h3><p>At this point, you&rsquo;ll need to go to WordPress.org and <a href=\"https:\/\/wordpress.org\/download\/\" target=\"_blank\" rel=\"noopener\">download the latest version<\/a> of WordPress:<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/02\/download-wordpress-landing-page.png\"><img decoding=\"async\" width=\"1024\" height=\"602\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/02\/download-wordpress-landing-page-1024x602.png\" alt=\"Download WordPress page\" class=\"wp-image-78706\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/02\/download-wordpress-landing-page.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/02\/download-wordpress-landing-page-300x176.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/02\/download-wordpress-landing-page-150x88.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/02\/download-wordpress-landing-page-768x451.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><p>Open up the WordPress folder on your machine, and locate the <strong>wp-sample-config.php<\/strong>&nbsp;file:<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1024\" height=\"449\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2018\/05\/The-wp-config-sample.php-file.jpg\" alt=\"The wp-config-sample.php file\" class=\"wp-image-9400\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/The-wp-config-sample.php-file.jpg 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/The-wp-config-sample.php-file-150x66.jpg 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/The-wp-config-sample.php-file-300x131.jpg 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/The-wp-config-sample.php-file-768x336.jpg 768w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/The-wp-config-sample.php-file-990x434.jpg 990w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/The-wp-config-sample.php-file-1320x578.jpg 1320w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div><p>Open this file in your preferred text editor (such as TextEdit). You&rsquo;ll need to locate this line of text:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">define('DB_NAME', 'database_name_here');<\/pre><p>Replace&nbsp;<em>database_name_here<\/em> with whatever you named your database in the last step. Then, look for these two lines:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">define('DB_USER', 'username_here');\ndefine('DB_PASSWORD', 'password_here');<\/pre><p>You&rsquo;ll need to replace <em>username_here<\/em> with <em>root<\/em>, and delete <em>password_here<\/em> entirely. The resulting text should look like this:<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1024\" height=\"240\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2018\/05\/wp-sample-config-file.jpg\" alt=\"wp-sample-config file\" class=\"wp-image-9403\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/wp-sample-config-file.jpg 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/wp-sample-config-file-150x35.jpg 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/wp-sample-config-file-300x70.jpg 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/wp-sample-config-file-768x180.jpg 768w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/wp-sample-config-file-990x232.jpg 990w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div><p>Once you&rsquo;ve done that, save the file as <strong>wp-config.php<\/strong>. You&rsquo;ll need to ensure that it is placed in the <strong>htdocs<\/strong>&nbsp;subfolder within the XAMPP folder. You&rsquo;ll also need to paste your WordPress install folder into <strong>htdocs<\/strong> as well.<\/p><p>Finally, navigate to&nbsp;<em>http:\/\/localhost\/wp\/<\/em> in your browser. Once there, follow the standard WordPress installation procedure. When that&rsquo;s all done, you&rsquo;ll have a locally-hosted WordPress site ready to go!<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-set-up-wordpress-multisite-on-xampp\">How to Set Up WordPress Multisite on XAMPP<\/h2><p>Now that you know how to use XAMPP for a single WordPress installation, you may want to use it to create a multisite network. This enables you to create a network of websites that are all managed from a single WordPress installation. There are a lot of applications for a multisite installation. For instance, it presents a useful way to test how your newly-developed themes and\/or plugins will function on a variety of sites.<\/p><p>To get started, you&rsquo;ll need to open up your&nbsp;<strong>wp-config.php <\/strong>file in a text editor again. You&rsquo;ll then need to add the following lines of code at the bottom, right above the line <em>* That&rsquo;s all, stop editing! Happy blogging. *<\/em>:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">define('WP_DEBUG', false);\ndefine('WP_ALLOW_MULTISITE', true);<\/pre><p>After you&rsquo;ve ensured that Apache and MySQL are still running on XAMPP, log in to your localhost site. Then, navigate to <strong>Tools<\/strong> &gt; <strong>Network Setup:<\/strong><\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1024\" height=\"402\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2018\/05\/WordPress-Tools-Network-Setup-Option.jpg\" alt=\"WordPress Tools Network Setup Option\" class=\"wp-image-9419\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/WordPress-Tools-Network-Setup-Option.jpg 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/WordPress-Tools-Network-Setup-Option-150x59.jpg 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/WordPress-Tools-Network-Setup-Option-300x118.jpg 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/WordPress-Tools-Network-Setup-Option-768x301.jpg 768w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/WordPress-Tools-Network-Setup-Option-990x389.jpg 990w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2018\/05\/WordPress-Tools-Network-Setup-Option-1320x520.jpg 1320w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div><p>Once you&rsquo;ve entered a network title, select <strong>Install<\/strong>. You will be prompted to edit your <strong>wp-config.php<\/strong> and <strong>.htaccess<\/strong> files.<\/p><p>Open up your <strong>wp-config.php&nbsp;<\/strong>file once more. You&rsquo;ll need to add the following code beneath the lines you added previously:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">define('MULTISITE', true);\ndefine('SUBDOMAIN_INSTALL', false);\ndefine('DOMAIN_CURRENT_SITE', 'localhost');\ndefine('PATH_CURRENT_SITE', '\/');\ndefine('SITE_ID_CURRENT_SITE', 1);\ndefine('BLOG_ID_CURRENT_SITE', 1);<\/pre><p>Next, you&rsquo;ll need to open up (or create) your <a href=\"\/uk\/tutorials\/create-default-wordpress-htaccess-file\">.<strong>htaccess<\/strong> file<\/a>&nbsp;in the same directory as your <strong>wp-config.php<\/strong> file. Then, replace all the existing lines in that file with the following snippet:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># BEGIN WordPress\nRewriteEngine On\nRewriteBase \/\nRewriteRule ^index\\.php$ - [L]\n\n# add a trailing slash to \/wp-admin\nRewriteRule ^([_0-9a-zA-Z-]+\/)?wp-admin$ $1wp-admin\/ [R=301,L]\n\nRewriteCond %{REQUEST_FILENAME} -f [OR]\nRewriteCond %{REQUEST_FILENAME} -d\nRewriteRule ^ - [L]\nRewriteRule ^([_0-9a-zA-Z-]+\/)?(wp-(content|admin|includes).*) $2 [L]\nRewriteRule ^([_0-9a-zA-Z-]+\/)?(.*\\.php)$ $2 [L]\nRewriteRule . index.php [L]\n\n# END WordPress<\/pre><p>Save the file and close it. Now, you should be able to access individual sites in your dashboard when you log in to your local WordPress installation.<\/p><h2 class=\"wp-block-heading\" id=\"h-what-to-do-with-your-local-wordpress-installation\">What to Do With Your Local WordPress Installation<\/h2><p>Once you know how to use XAMPP and have a local WordPress site to experiment on, what you do next will largely depend on the kind of development project you&rsquo;re embarking on. To get you started, WordPress.org offers a great beginner&rsquo;s guide on how to <a href=\"https:\/\/codex.wordpress.org\/Test_Driving_WordPress\" target=\"_blank\" rel=\"noopener\">test drive WordPress<\/a>.<\/p><p>If you&rsquo;re interested in theme development, you may want to see our guide on <a href=\"\/uk\/tutorials\/create-wordpress-theme-html5\">how to develop a WordPress theme<\/a>, or check out such sites as <a href=\"https:\/\/themeshaper.com\/\" target=\"_blank\" rel=\"noopener nofollow\">Theme Shaper<\/a>.&nbsp;Using your local environment, you can safely edit your files to experiment with new themes and their associated functionality.<\/p><p>If you want to learn how to use XAMPP and WordPress together to test your coding knowledge and gain more PHP experience, there are a number of helpful guides for that as well.&nbsp;<a href=\"https:\/\/www.codecademy.com\/\" target=\"_blank\" rel=\"noopener nofollow\">Codecademy<\/a>&nbsp;offers an excellent variety of tutorials that cover PHP and HTML fundamentals, plus much more.<\/p><p>While using your local WordPress installation for development, you&rsquo;ll also want to have resources at hand for troubleshooting and honing your skills. <a href=\"https:\/\/stackexchange.com\/\" target=\"_blank\" rel=\"noopener\">Stack Exchange<\/a> is a thriving online forum where you can pose questions to the WordPress development community, as well as gain invaluable insights. Finally, you&rsquo;ll probably want to become a regular on the <a href=\"https:\/\/wordpress.org\/support\/forums\/\" target=\"_blank\" rel=\"noopener\">WordPress.org support forum<\/a>.<\/p><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-large\"><a href=\"\/uk\/wordpress-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner-1024x300.png\" alt=\"\" class=\"wp-image-111781\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/06\/New-WP_in-text-banner-1024x300.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/06\/New-WP_in-text-banner-300x88.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/06\/New-WP_in-text-banner-150x44.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/06\/New-WP_in-text-banner-768x225.png 768w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/06\/New-WP_in-text-banner-1536x450.png 1536w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/06\/New-WP_in-text-banner.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>As we have seen, XAMPP is a powerful and versatile solution for setting up a local web server. It presents a perfect way to create an environment for basic WordPress coding, experimenting with multisite settings, tweaking themes, and much more. Though it is not the only tool that you can use. A great alternative is <a href=\"\/uk\/tutorials\/run-docker-wordpress\">setting up WordPress using Docker<\/a>.<\/p><p>Do you have any questions about how to use XAMPP or your new local WordPress site? Let us know in the comments section below!<\/p><p><div class=\"protip\">\n                    <h4 class=\"title\">Learn Other Expert WordPress Techniques<\/h4>\n                    <p><a href=\"\/uk\/tutorials\/xmlrpc-wordpress\">What Is Xmlrpc.php<\/a><br>\n<a href=\"\/uk\/tutorials\/wp-config-php\">Everything You Need to Know About wp-config.php<\/a><br>\n<a href=\"\/uk\/tutorials\/how-to-become-wordpress-developer\">How to Become a WordPress Developer<\/a><br>\n<a href=\"\/uk\/tutorials\/how-to-perform-search-and-replace-in-wordpress-database\/\">How to Perform a WordPress Search and Replace<\/a><br>\n<a href=\"\/uk\/tutorials\/what-are-wordpress-hooks\/\">What Are WordPress Hooks?<\/a><br>\n<a href=\"\/uk\/tutorials\/wordpress-custom-css\">How to Add Custom CSS to WordPress<\/a><br>\n<a href=\"\/uk\/tutorials\/speed-up-wordpress\">How to Speed Up a WordPress Website<\/a><\/p>\n                <\/div>&ldquo;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Setting up a locally-hosted environment is a crucial step in any WordPress development project. Doing this enables you to safely test your site&rsquo;s features and functionality, on a site that&rsquo;s completely private. In this article, we&rsquo;ll explore how to use&nbsp;XAMPP to set up a local web server for developing and testing your WordPress site. This [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/uk\/tutorials\/how-to-use-xampp-wordpress\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":76,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to Use XAMPP to Set Up a Local WordPress Site (In 3 Steps)","rank_math_description":"Learn how to use XAMPP and install WordPress in this step-by-step guide \u2013 from installing to configuring your environment.","rank_math_focus_keyword":"how to use XAMPP, how to install wordpress on xampp, xampp tutorial, xampp wordpress, install wordpress locally","footnotes":""},"categories":[22633],"tags":[],"class_list":["post-9376","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/how-to-use-xampp-wordpress","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/como-usar-xampp-wordpress","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/cara-install-wordpress-di-xampp","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/how-to-use-xampp-wordpress","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/how-to-use-xampp-wordpress\/","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/how-to-use-xampp-wordpress\/","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/como-usar-xampp-wordpress","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/como-usar-xampp-wordpress","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/como-usar-xampp-wordpress","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/how-to-use-xampp-wordpress","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/how-to-use-xampp-wordpress","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/how-to-use-xampp-wordpress","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/how-to-use-xampp-wordpress","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/posts\/9376","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/users\/76"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/comments?post=9376"}],"version-history":[{"count":33,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/posts\/9376\/revisions"}],"predecessor-version":[{"id":105004,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/posts\/9376\/revisions\/105004"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/media?parent=9376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/categories?post=9376"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/tags?post=9376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}