What Is XAMPP? XAMPP Installation, Usage and Fixing Apache/MySQL Not Starting

Sunucun 7 min read

XAMPP is a free, open-source package that sets up a local web server on your computer. Its name comes from the initials of its components: X (cross-platform), Apache, MariaDB (formerly MySQL), PHP and Perl. With XAMPP you can build and test sites that use PHP and a database, such as WordPress, on your own computer without putting them online. In this article we explain what XAMPP is used for, how to install it on Windows step by step, how to use htdocs and phpMyAdmin, how to install WordPress on XAMPP, and how to fix the common “Apache won’t start” and “MySQL won’t start” errors.

Illustration: MySQL

What Is XAMPP Used For?

  • Local development: You run and test a PHP site on your own computer before uploading it to a live server.
  • Learning: It is a free, risk-free environment for learning PHP, SQL and how a web server works.
  • Trying out a CMS: You can test systems such as WordPress, Joomla or OpenCart, along with themes and plugins, without breaking a live site.
  • Database work: With phpMyAdmin you create databases, run SQL queries, and take and restore backups.

XAMPP is a development tool, not meant for production. Apache Friends also notes that the default settings are kept loose for ease of development; for example, the database administrator account (root) has no password by default. To put a real site online, use hosting or a server with properly configured security.

Components Included in XAMPP

As of November 2026, the Windows packages on the Apache Friends download page include:

ComponentVersionRole
Apache2.4.65Web server; answers requests from the browser.
MariaDB10.11.16MySQL-compatible database server. It still appears as “MySQL” in the control panel.
PHP8.5.12 / 8.4.27 / 8.3.36 (depending on the package)Server-side programming language.
phpMyAdmin5.2.3Browser interface for managing databases.
Strawberry Perl5.42.1.1Runs Perl scripts.
Others—OpenSSL, XAMPP Control Panel 3.3.0, FileZilla FTP Server, Mercury Mail, Tomcat, Webalizer.

The download page currently lists only Windows builds; older versions for Linux and macOS are available under “More Downloads”. If you want to know how MariaDB and PHP work together, see our articles What is MySQL and integrating MySQL with PHP.

Installing XAMPP (Windows)

  1. Download: Download the package matching the PHP version your project needs, only from the official site apachefriends.org. If you are not sure, choose the latest version; for an older project, choose the PHP version that project supports.
  2. Start the installer: Run the downloaded .exe file. If you see an antivirus or User Account Control (UAC) warning, take note of the message advising you not to install XAMPP in C:Program Files.
  3. Select components: Keep Apache, MySQL, PHP and phpMyAdmin ticked. You can untick FileZilla, Mercury, Tomcat and Perl if you do not need them.
  4. Installation folder: Use the default C:xampp folder. Do not install under Program Files, to avoid write-permission problems.
  5. Finish the installation and choose to start the control panel on the last screen. If Windows Firewall asks for permission for Apache, allowing it for “Private networks” is enough.
  6. Start the services: In the XAMPP Control Panel, press the Start buttons on the Apache and MySQL rows. The module names turn green.
  7. Test: Open http://localhost in your browser; if the XAMPP welcome page appears, the installation is complete. http://localhost/phpmyadmin opens phpMyAdmin.

Using XAMPP: htdocs and phpMyAdmin

  • Where do files go? Your site files go in the C:xampphtdocs folder. For example, htdocsmyprojectindex.php opens in the browser at http://localhost/myproject/.
  • If a PHP file shows as code in the browser, do not open it by double-clicking; always open it through http://localhost/.... PHP only runs through Apache.
  • Creating a database: In phpMyAdmin click New, type the database name, choose utf8mb4_unicode_ci or utf8mb4_general_ci as the collation and press Create. For backups and restores, see our article on MySQL database backup and restore.
  • PHP settings: Use Config → PHP (php.ini) on the Apache row of the control panel to change values such as upload_max_filesize and memory_limit. Stop and restart Apache after the change.

Installing WordPress on XAMPP

  1. Download the latest WordPress ZIP from wordpress.org and extract it to C:xampphtdocswordpress.
  2. In phpMyAdmin, create a new database called wordpress.
  3. Open http://localhost/wordpress in the browser and choose a language.
  4. On the database details screen, enter database name wordpress, username root, an empty password and host localhost.
  5. Set the site title, admin username and password, and finish the installation. The dashboard is at http://localhost/wordpress/wp-admin.

XAMPP Apache Won’t Start: Port Conflict

Apache uses ports 80 (HTTP) and 443 (HTTPS) by default. If another program is using one of these ports, the control panel shows a warning such as “Port 80 in use by …” or “Apache shutdown unexpectedly”.

  1. Find out who is using the port: The Netstat button in the control panel, or the command netstat -ano | findstr :80 in Command Prompt, shows the PID of the process using the port. In Task Manager’s Details tab you can see which program that PID belongs to.
  2. Stop that program: Common culprits are IIS (World Wide Web Publishing Service), another local server package (WAMP, Laragon) or some virtualization and remote access software.
  3. Or change Apache’s port: In Config → Apache (httpd.conf) on the Apache row, change Listen 80 to Listen 8080 and ServerName localhost:80 to ServerName localhost:8080. If 443 conflicts, change Listen 443 to, for example, 4433 in Config → Apache (httpd-ssl.conf). Save and start Apache; the site now opens at http://localhost:8080.

XAMPP MySQL Won’t Start

  1. Check the error log: Logs → mysql_error.log on the MySQL row tells you the real cause, and shows which of the steps below you need.
  2. Port 3306 may be taken: If a separate MySQL or MariaDB service is installed on the computer, XAMPP’s MySQL cannot start. Check with netstat -ano | findstr :3306; stop the other service in services.msc or change the port=3306 values in XAMPP’s my.ini file.
  3. Corruption after an unexpected shutdown: If MySQL will not start after a power cut or forced shutdown, the data files may be damaged. Before touching anything, copy the whole C:xamppmysqldata folder somewhere else. Then repair according to the message in the error log; see our article on MySQL error debugging for troubleshooting steps.
  4. Run as administrator: If the control panel is not opened with administrator rights, installing services and some file operations may fail.

Other Common Problems

  • localhost will not open / “Not Found”: Check that Apache is running, add the port number to the address if you changed it (localhost:8080), and make sure the file really is under htdocs.
  • phpMyAdmin says “Access denied”: If you gave the root user a password, you also need to put the same password in the $cfg['Servers'][$i]['password'] line of C:xamppphpMyAdminconfig.inc.php.
  • PHP errors are not shown: During development set display_errors = On and error_reporting = E_ALL in php.ini; turn this off on a live server.
  • Updating XAMPP: XAMPP has no self-update feature. Back up your htdocs folder and your databases (by exporting them from phpMyAdmin), install the new version in a separate folder and move your data there.

XAMPP Alternatives

ToolMain feature
WampServerWindows only; switching between several PHP versions is easy.
LaragonWindows; lightweight, creates an automatic local domain for each project.
MAMPmacOS and Windows; popular among Mac users.
DockerRuns each project in its own container, in an environment very close to the live server. See server virtualization with Docker.

Moving a Project From XAMPP to a Live Server

To publish a site you built locally, upload the files to the server with FTP or your hosting panel’s file manager, export the database from phpMyAdmin and import it into the database on the server. Then replace the database details in the configuration file (wp-config.php in WordPress) with the server’s, and in WordPress also replace the http://localhost/... addresses with your real domain.

Conclusion

XAMPP is a free tool that installs Apache, MariaDB, PHP and Perl in one package and lets you develop PHP-based sites on your own computer. After downloading it from the official site and installing it in C:xampp, you put your files in htdocs and run them at http://localhost. If Apache will not start, port 80/443 is usually taken by another program; if MySQL will not start, check the error log first and back up the data folder. Use XAMPP only for development, and choose a server with configured security for live sites.

Categories

Latest guides