Development Workflow

Install and Configure XAMPP on Windows for PHP Development

Set up Apache, MariaDB and PHP with XAMPP on Windows, then verify the command-line and browser environments.

XAMPP provides a bundled local web-development stack for Windows. It is useful for learning PHP and testing conventional Apache/PHP/database applications, provided it is treated as a development environment rather than a public production server.

Install deliberately

Download the installer from the Apache Friends website. Choose a maintained XAMPP release that includes a PHP version compatible with the project. Install outside protected Windows folders when possible, for example in a dedicated development directory, to reduce permission friction. Do not install components the project does not need.

Start and verify services

Open the XAMPP Control Panel and start Apache and MySQL (the bundled database service may be MariaDB depending on the release). Visit http://localhost/ and confirm the dashboard loads. Put a small phpinfo()` test file in the configured document root, inspect the PHP version and extensions, then remove that diagnostic file because it exposes configuration details.

Check the command line separately

Open Command Prompt and run the XAMPP PHP executable with php -v. The PHP used by Apache and the PHP found first in the Windows PATH can be different. For project commands, call the intended executable explicitly or configure PATH carefully. Verify Composer uses the same PHP runtime and required extensions.

Place projects safely

Create a dedicated project directory under the web root or configure an Apache virtual host with a project-specific document root. Keep .env files, backups, logs and uploaded private files outside the public document root. Use a database account with limited privileges rather than assuming root credentials are suitable for every project.

Troubleshooting

If Apache fails to start, check whether another service already occupies ports 80 or 443. Inspect the Apache error log before changing ports. If MySQL fails, check for another database service using its port and inspect the database error log. Do not delete database files to resolve a startup issue.

Further reading

Share this page Help other developers discover this resource.