Get DevWP - WordPress Development Theme
Local WordPress Development with XAMPP for Windows
XAMPP provides a local Apache, MySQL, and PHP stack for WordPress development on Windows. Enable key PHP extensions, add PHP to your system PATH, and tune php.ini for local development.

Local WordPress Development with XAMPP for Windows

4 min read

XAMPP bundles Apache, MySQL, PHP, and Perl into a single Windows installer — everything you need for local WordPress development. Download XAMPP from Apache Friends and run the installer. On macOS, check out my MAMP setup guide instead.

Why XAMPP?

I’ve tried most of the local development options for Windows — XAMPP is my go-to because it’s the simplest to configure. My production server runs Linux, so an exact match isn’t possible, but I configure PHP and MySQL versions to stay as close as I can.

This is part of a series on building custom WordPress themes with DevWP. Check out the companion video:

Enabling Essential PHP Extensions

XAMPP ships with some PHP extensions disabled. Enable these three before installing WordPress:

  1. Start XAMPP — Open the XAMPP Control Panel.
  2. Configure Apache — Click on the Config button next to Apache and select PHP.ini.
  3. Edit PHP.ini — Search for extension=fileinfo and remove the semicolon for the following extensions: extension=gd, extension=intl, extension=zip.
  4. Restart Apache — Save the changes and restart Apache via the XAMPP Control Panel.

Key File Locations

You’ll reference these paths throughout the setup — bookmark them:

  • PHP Executable: C:\xampp\php\php.exe
  • PHP Configuration: C:\xampp\php\php.ini — adjust memory limits, upload sizes, and extensions here
  • MySQL Configuration: C:\xampp\mysql\bin\my.ini — adjust buffer pools and packet sizes here

Adding PHP and MySQL to Your System Path

CLI tools like composer, phpcs, and phpstan need to find PHP on your system. Adding PHP and MySQL to your PATH lets you use them from any terminal window:

  1. Search for Environment Variables in the Windows search bar and open it.
  2. Click the Environment Variables button.
  3. In the “System Variables” section, find and select the “Path” variable, then click Edit.
  4. Click New and add C:\xampp\php.
  5. Click New again and add C:\xampp\mysql\bin.
  6. Save the changes and restart your computer.
  7. Open Command Prompt and type php -v to confirm PHP is in your path.

Fine-tuning PHP and MySQL Settings

PHP.ini Adjustments

Open C:\xampp\php\php.ini and update the following settings:

memory_limit = 512M
max_execution_time = 300
max_input_time = 240
post_max_size = 64M
upload_max_filesize = 64M
mysql.connect_timeout = 240

Save the file and restart Apache via the XAMPP Control Panel.

MySQL (my.ini) Adjustments

Open C:\xampp\mysql\bin\my.ini and update the following settings:

[mysqld]
max_allowed_packet = 64M
innodb_buffer_pool_size = 256M

[mysqldump]
max_allowed_packet = 64M

Save the file and restart MySQL via the XAMPP Control Panel.

Document Root and Local URL

  • Local URL: http://localhost
  • Document Root: C:\xampp\htdocs

This is where you will place your various WordPress installations. For example:

  • C:\xampp\htdocs\wordpress
  • C:\xampp\htdocs\dev

Common XAMPP Issues and Fixes

Common XAMPP issues and how to fix them:

  • Make sure you have the latest version of XAMPP installed.
  • Check for port conflicts — Apache uses port 80 and MySQL uses port 3306. Run netstat -ano | findstr :80 in Command Prompt to see what’s listening.
  • Check the XAMPP error logs located in C:\xampp\apache\logs and C:\xampp\mysql\data for any specific error messages.
  • Verify that your firewall or antivirus software is not blocking XAMPP.

XAMPP FAQ

Do I need XAMPP or can I use WSL instead?

WSL (Windows Subsystem for Linux) is a valid option if you’re comfortable with Linux. XAMPP is simpler — one installer, a GUI control panel, and no command-line configuration. I recommend XAMPP for beginners and WSL for developers who already know their way around a Linux terminal.

Can I change the PHP version in XAMPP?

Not directly — XAMPP bundles a specific PHP version with each release. To switch versions, download a different XAMPP release that includes the PHP version you need. You can run multiple XAMPP versions side by side in different directories (e.g., C:\xampp-php81 and C:\xampp-php83), but only one can run at a time.

Why does Skype block Apache from starting?

Skype historically used port 80 by default, conflicting with Apache. In Skype settings, go to Advanced → Connection and uncheck “Use port 80 and 443 as alternatives for incoming connections.” Restart Apache after making the change.

With XAMPP configured, you have a local environment ready for WordPress development. Install WordPress in your htdocs directory and start building. For the rest of the dev environment setup, check out my guides on Git, Node.js, Composer, and VS Code.



View Our Themes