Contents
How to Install WordPress Step by Step Locally with XAMPP
Installing WordPress on your local computer is an excellent way to create a sandbox for development, testing, or learning how WordPress works—without affecting a live site. In this comprehensive guide, we’ll walk you through each step of setting up XAMPP on Windows, Mac, or Linux, configuring a database, and installing WordPress locally.
Prerequisites
- Basic familiarity with file systems and running installers.
- Administrator (or sudo) access to install software.
- Internet connection to download required packages.
1. Download XAMPP
Visit the official XAMPP website to ensure you get the latest stable release:
https://www.apachefriends.org/index.html
Platform | PHP Versions | Size |
---|---|---|
Windows | 7.4, 8.0 | 150 MB |
macOS | 7.4, 8.0 | 170 MB |
Linux | 7.4, 8.0 | 140 MB |
2. Install XAMPP
- Run the installer you downloaded.
- Select components Apache, MySQL, phpMyAdmin, and PHP. Others are optional.
- Choose an installation path (default is usually C:xampp on Windows or /Applications/XAMPP on macOS).
- Allow firewall permissions if prompted.
- Finish the setup and launch the XAMPP Control Panel.
3. Start Apache and MySQL
In the XAMPP Control Panel, click Start next to Apache and MySQL. Both modules should turn green, indicating they’re running.
4. Create a Database for WordPress
WordPress requires a MySQL (or MariaDB) database.
- Open your browser and go to http://localhost/phpmyadmin.
- Click Databases at the top.
- Under Create database, enter a name like
wordpress_db
. - Select utf8mb4_unicode_ci as the collation for full Unicode support.
- Click Create.
5. Download WordPress
Get the latest WordPress package from the official source:
https://wordpress.org/download/
Save the ZIP file to your computer and extract it.
6. Move WordPress Files into XAMPP
- Locate your XAMPP installation’s htdocs folder (e.g., C:xampphtdocs or /Applications/XAMPP/htdocs).
- Create a new folder, e.g.,
mywp
. - Copy all extracted WordPress files into this
mywp
folder.
7. Configure wp-config.php
- Inside
mywp
, renamewp-config-sample.php
towp-config.php
. - Open
wp-config.php
with a text editor. - Update the following lines with your database info:
define(DB_NAME, wordpress_db) define(DB_USER, root) define(DB_PASSWORD, ) // default is empty for XAMPP define(DB_HOST, localhost)
- Save and close the file.
8. Run the WordPress Installer
- In your browser, navigate to http://localhost/mywp/.
- Select your language and click Continue.
- Fill in the Site Title, Username, Password, and Email.
- Click Install WordPress.
- Upon success, click Log In to access your local WordPress dashboard.
9. Post-Installation Tips
- Permalinks: Go to Settings → Permalinks and choose a friendly structure (e.g., Post name).
- Debug Mode: For development, enable
WP_DEBUG
inwp-config.php
:define(WP_DEBUG, true)
- Backups: Even local sites benefit from periodic backups of
wp-content
and the database.
10. Useful Resources
Conclusion
Following these steps, you now have a fully functional WordPress installation running locally via XAMPP. This environment is ideal for theme and plugin development, testing updates, or practicing WordPress management in a safe, offline setting. Happy building!
|
Acepto donaciones de BAT's mediante el navegador Brave 🙂 |