Posted At: Mar 25, 2025 - 31 Views
This guide will walk you through the complete installation of WordPress on XAMPP for local development. Follow each step carefully to set up your WordPress environment on your computer.
Step 1: Download and Install XAMPP
XAMPP is a local server environment that includes Apache (for running PHP), MySQL (for the database), and PHPMyAdmin (for managing databases).
1.1 Download XAMPP
- Go to the official XAMPP website:
๐ https://www.apachefriends.org/download.html - Select your operating system (Windows, macOS, Linux).
- Download the latest XAMPP version (PHP 8.x recommended).
1.2 Install XAMPP
- Run the XAMPP installer you downloaded.
- Click Next and select the required components:
- Apache โ (Required)
- MySQL โ (Required)
- PHP โ (Required)
- phpMyAdmin โ (Required)
- Other components are optional.
- Choose the installation directory (default:
C:\xampp\
). - Click Next and complete the installation.
1.3 Start XAMPP Services
- Open XAMPP Control Panel.
- Click Start for both:
- Apache (for PHP processing)
- MySQL (for the database)
- Once both services are running (marked green), XAMPP is ready.
๐ Test if XAMPP is working by opening a browser and visiting:
๐ http://localhost/
If you see the XAMPP dashboard, it means XAMPP is working correctly.
Step 2: Download and Extract WordPress
Now, letโs download WordPress and place it in the XAMPP directory.
2.1 Download WordPress
- Visit the official WordPress website:
๐ https://wordpress.org/download/ - Click Download WordPress (latest version).
- The file will be downloaded as a ZIP file.
2.2 Extract WordPress into XAMPPโs htdocs Folder
- Go to the XAMPP installation folder:
Windows:C:\xampp\htdocs\
Mac:/Applications/XAMPP/htdocs/
- Extract the WordPress ZIP file inside the
htdocs
folder. - Rename the extracted folder (e.g.,
mywebsite
). - Now, your WordPress files should be located at:
๐C:\xampp\htdocs\mywebsite\
Step 3: Create a WordPress Database
WordPress needs a MySQL database to store data like posts, users, and settings.
3.1 Open phpMyAdmin
- In a browser, go to:
๐http://localhost/phpmyadmin/
- This opens phpMyAdmin, a database management tool.
3.2 Create a New Database
- Click on the Databases tab.
- Under Create database, enter a name (e.g.,
wordpress_db
). - Choose utf8_general_ci as the collation.
- Click Create.
๐ The database is now ready. You donโt need to create tablesโWordPress will handle that during installation.
Step 4: Configure WordPress Installation
Now, letโs connect WordPress to the database and complete the installation.
4.1 Open WordPress Setup in Browser
- Open a browser and go to:
๐http://localhost/mywebsite/
- Select your Language and click Continue.
4.2 Enter Database Connection Details
You will be asked to enter database details:
- Database Name:
wordpress_db
(the name you created in phpMyAdmin) - Username:
root
(default for XAMPP) - Password: (leave it blank)
- Database Host:
localhost
- Table Prefix:
wp_
(default, change if needed)
Click Submit.
If the connection is successful, click Run the Installation.
Step 5: Set Up WordPress Admin Account
5.1 Enter Website and Admin Details
- Site Title: Your website name.
- Username: Your WordPress admin username.
- Password: Set a strong password.
- Your Email: Enter your email.
- Search Engine Visibility: Leave unchecked (only relevant for live sites).
Click Install WordPress.
5.2 Login to WordPress Dashboard
Once installed, go to:
๐ http://localhost/mywebsite/wp-admin/
Enter your username & password, then click Log In.
๐ Youโre now inside your WordPress dashboard!
Step 6: Start Building Your WordPress Website
6.1 Choose a Theme
- Go to Appearance > Themes.
- Click Add New and choose a theme or upload one.
6.2 Install Plugins
- Go to Plugins > Add New to install useful plugins like:
- Elementor (for easy page building)
- Yoast SEO (for SEO optimization)
- Contact Form 7 (for forms)
- WooCommerce (for eCommerce)
6.3 Start Creating Content
- Go to Posts to write blog posts.
- Go to Pages to create new website pages.
Troubleshooting Issues
1. Apache or MySQL Not Starting?
- Error: Port 80 or 3306 is already in use?
- Open XAMPP Control Panel > Config > Service and Port Settings.
- Change Apache port to 8080 and MySQL port to 3307.
- Restart XAMPP.
2. WordPress Canโt Connect to Database?
- Double-check:
- Database Name:
wordpress_db
- Username:
root
- Password: (leave blank)
- Database Host:
localhost
- Database Name:
3. "The Requested URL Was Not Found" Error?
- Open XAMPP Control Panel โ Apache โ Click Config โ Select httpd.conf.
Find this line:
DocumentRoot "C:/xampp/htdocs"
- Ensure the correct path to your WordPress folder is set.
Final Words ๐
Congratulations! Youโve successfully installed WordPress on XAMPP for local development. ๐
Now you can: โ
Develop your website locally.
โ
Test themes and plugins before deploying live.
โ
Learn and experiment without breaking a real website.