Blog · WebJi® India

How to Install WordPress on XAMPP

Quick answer: Install XAMPP, start Apache and MySQL from the control panel, create a database in phpMyAdmin, unzip WordPress into the htdocs folder, then open http://localhost/yoursite and enter the database name, the root user, and a blank password. It works when the WordPress setup wizard appears.
✓ In business since 2005✓ INR + GST billing✓ 24/7 Email Support — avg reply < 60 min
Indian small-business owner packing courier boxes beside a laptop running his online store — how to install wordpress on xampp

What XAMPP gives you, and what it does not

XAMPP puts Apache, MySQL, PHP, and phpMyAdmin on your own machine in one installer. That is enough to run WordPress offline, test a plugin, or build a site before it has a host. It is not a production server and it is not a true staging copy of your live site.

XAMPP on your laptopLive hosting
Who can reach itOnly your computerAnyone on the internet
PHP versionWhatever the installer shippedThe host's managed version
DatabaseMySQL with a blank root passwordSeparate database and user with a password
Caching and CDNNoneServer cache, object cache, CDN
Safe for real trafficNoYes

Because the PHP version and the caching layer differ, a site that runs perfectly in XAMPP can still fail on the host. Treat a local install as a place to build and test content, not as proof that the live site will behave the same way.

Install XAMPP and start the two services

Download the installer from the Apache Friends site, choosing a build with PHP 8.2 or newer for current WordPress. During setup you can deselect the extras and keep Apache, MySQL, PHP, and phpMyAdmin.

  1. Run the installer, accept the default location, and finish setup.
  2. Open the XAMPP Control Panel and click Start next to Apache, then Start next to MySQL. Both module names turn green when they are running.
  3. Open http://localhost in a browser. The XAMPP dashboard confirms that Apache is serving.
  4. Check MySQL by opening phpMyAdmin from that dashboard. If the login page loads, the database service is up.

You know this step worked when both modules stay green for a minute and localhost shows the dashboard rather than a browser error. If Apache flashes green then stops, you have a port conflict, covered below.

Create the database in phpMyAdmin

WordPress needs an empty database before the installer can run. Locally you do not need a separate database user, because XAMPP's root account with a blank password is meant for this machine only.

  1. Open http://localhost/phpmyadmin and click the Databases tab.
  2. Type a name such as wp_local. Use lowercase letters and underscores, no spaces.
  3. Choose utf8mb4_unicode_ci as the collation, which is what WordPress expects for emoji and non-Latin text.
  4. Click Create. The empty database appears in the left column.

If you plan to keep several local sites, give each one its own database and its own folder name, so a plugin test on one site cannot touch another.

Put WordPress in the htdocs folder

The htdocs folder is the document root of your local Apache. A folder inside it becomes a site at http://localhost/foldername.

Systemhtdocs location
WindowsC:\xampp\htdocs\
macOS/Applications/XAMPP/htdocs/
Linux/opt/lampp/htdocs/

Download latest.zip from wordpress.org, create a folder such as mysite inside htdocs, and extract the WordPress files into it so that wp-admin, wp-content, wp-includes, and index.php sit directly in that folder. If you end up with htdocs/mysite/wordpress/wp-admin, the site will open one level too deep and the installer will complain about missing files.

Run the installer at localhost

Open http://localhost/mysite. The welcome screen asks for the database details, then the site details, then hands you a login.

  1. On the database screen, enter wp_local as the database name, root as the username, leave the password empty, and keep localhost as the host.
  2. Leave the table prefix as wp_ on a local site, then submit.
  3. If WordPress cannot write wp-config.php, it prints the file contents instead. Create wp-config.php in the site folder, paste that text, save, and click Run the installation.
  4. Fill in the site title, an admin username that is not "admin", a strong password, and your email. Leave search engine visibility unchecked, since the site is local.

The install is complete when the login page appears at /wp-login.php and the dashboard loads. Bookmark the address, because Apache and MySQL must both be started each time you reboot the machine.

Fix the port conflict and the other local errors

Local stacks fail in a small number of predictable ways. Most of them are one setting in one file, and the file is named in the XAMPP control panel.

SymptomCauseFix
Apache will not startAnother program owns port 80, often IIS, Skype, or a printer serviceStop that program, or set Listen 8080 in httpd.conf and use localhost:8080
MySQL shuts down immediatelyPort 3306 is already in use by another MySQL installStop the other service, or change the port in my.ini and in wp-config.php
phpMyAdmin returns 403Access is limited to local requestsEdit the Alias block in httpd-xampp.conf and allow the local network if you need it
Upload fails at a few megabytesPHP limits are low by defaultRaise upload_max_filesize and post_max_size in php.ini, then restart Apache
Plugin install times outmax_execution_time is too shortRaise it in php.ini and restart Apache

After any php.ini change, restart Apache from the control panel. PHP reads the file at start-up, so a running server keeps the old limits and the same error appears again.

Move the local site to a real domain

A local site contains hundreds of references to http://localhost/mysite. Uploading the files and importing the database without changing those strings gives a live site that redirects back to localhost, which is the most common migration failure.

  1. Export the database from phpMyAdmin as SQL, and zip the site folder.
  2. On the host, create a database and user, upload the files, and import the SQL file.
  3. Run a search and replace on the database, changing http://localhost/mysite to https://yourdomain.com, using a tool that handles serialised data such as WP-CLI search-replace or a migration plugin.
  4. Update the database credentials in wp-config.php, then log in and resave permalinks.

Do the search and replace before you log in, not after. Widgets and theme options store serialised arrays, and a plain text editor replace corrupts them, which is why the tools above exist.

From localhost to a live site on WebJi

When the local build is ready, WordPress hosting puts it on a server with PHP, MySQL, and certificates handled for you. Plans start at ₹400 per month before 18% GST, with a one-year term at ₹3,000.

If you would rather not run the search and replace yourself, the migration service moves the files and database for a one-time ₹700, covering up to five MySQL databases and 5 GB. Free migration is also available subject to terms and approval. Email support@webji.services with the local site size and the target domain; support is 24/7 by email in Hindi and English with an average first reply under 60 minutes.

Frequently Asked Questions

How do I install WordPress on XAMPP?

Install XAMPP and start Apache and MySQL, create a database in phpMyAdmin with utf8mb4_unicode_ci, extract WordPress into a folder inside htdocs, then open http://localhost/yourfolder and enter the database name, root as the user, and a blank password.

Is XAMPP good for learning WordPress?

Yes. It runs the same PHP and MySQL stack WordPress uses, costs nothing, and keeps experiments off a live site. It is not a production server, and it does not replicate your host's PHP version, caching, or server limits.

How do I create the WordPress database in phpMyAdmin?

Open http://localhost/phpmyadmin, click Databases, enter a name such as wp_local, choose utf8mb4_unicode_ci as the collation, and click Create. Locally the root user needs no password, so no separate database user is required.

Why will XAMPP Apache not start?

Port 80 is already taken, usually by IIS, Skype, or another web server. Close that program, or open httpd.conf from the Apache Config button and change Listen 80 to Listen 8080, then use http://localhost:8080.

Can I move my XAMPP site to live hosting?

Yes. Export the database, upload the files, import the database, and replace http://localhost/yourfolder with your live https URL in the database using WP-CLI search-replace or a migration plugin. Skipping the replace leaves a site that redirects to localhost.

What is the default phpMyAdmin password in XAMPP?

There is no password. XAMPP ships MySQL with a blank root password for local use, which is why the installer accepts an empty field. That default is one reason XAMPP must never be exposed to the internet.

Need help with this?

WebJi® support does it for you — free. Talk to our Jaipur team →