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.
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:
| Component | Version | Role |
|---|---|---|
| Apache | 2.4.65 | Web server; answers requests from the browser. |
| MariaDB | 10.11.16 | MySQL-compatible database server. It still appears as “MySQL” in the control panel. |
| PHP | 8.5.12 / 8.4.27 / 8.3.36 (depending on the package) | Server-side programming language. |
| phpMyAdmin | 5.2.3 | Browser interface for managing databases. |
| Strawberry Perl | 5.42.1.1 | Runs 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)
- 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.
- Start the installer: Run the downloaded
.exefile. If you see an antivirus or User Account Control (UAC) warning, take note of the message advising you not to install XAMPP inC:Program Files. - Select components: Keep Apache, MySQL, PHP and phpMyAdmin ticked. You can untick FileZilla, Mercury, Tomcat and Perl if you do not need them.
- Installation folder: Use the default
C:xamppfolder. Do not install under Program Files, to avoid write-permission problems. - 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.
- Start the services: In the XAMPP Control Panel, press the Start buttons on the Apache and MySQL rows. The module names turn green.
- Test: Open
http://localhostin your browser; if the XAMPP welcome page appears, the installation is complete.http://localhost/phpmyadminopens phpMyAdmin.
Using XAMPP: htdocs and phpMyAdmin
- Where do files go? Your site files go in the
C:xampphtdocsfolder. For example,htdocsmyprojectindex.phpopens in the browser athttp://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_ciorutf8mb4_general_cias 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_filesizeandmemory_limit. Stop and restart Apache after the change.
Installing WordPress on XAMPP
- Download the latest WordPress ZIP from wordpress.org and extract it to
C:xampphtdocswordpress. - In phpMyAdmin, create a new database called
wordpress. - Open
http://localhost/wordpressin the browser and choose a language. - On the database details screen, enter database name
wordpress, usernameroot, an empty password and hostlocalhost. - 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”.
- Find out who is using the port: The Netstat button in the control panel, or the command
netstat -ano | findstr :80in 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. - 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.
- Or change Apache’s port: In Config → Apache (httpd.conf) on the Apache row, change
Listen 80toListen 8080andServerName localhost:80toServerName localhost:8080. If 443 conflicts, changeListen 443to, for example,4433in Config → Apache (httpd-ssl.conf). Save and start Apache; the site now opens athttp://localhost:8080.
XAMPP MySQL Won’t Start
- 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.
- 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 theport=3306values in XAMPP’smy.inifile. - 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:xamppmysqldatafolder somewhere else. Then repair according to the message in the error log; see our article on MySQL error debugging for troubleshooting steps. - 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 underhtdocs. - 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 ofC:xamppphpMyAdminconfig.inc.php. - PHP errors are not shown: During development set
display_errors = Onanderror_reporting = E_ALLin php.ini; turn this off on a live server. - Updating XAMPP: XAMPP has no self-update feature. Back up your
htdocsfolder and your databases (by exporting them from phpMyAdmin), install the new version in a separate folder and move your data there.
XAMPP Alternatives
| Tool | Main feature |
|---|---|
| WampServer | Windows only; switching between several PHP versions is easy. |
| Laragon | Windows; lightweight, creates an automatic local domain for each project. |
| MAMP | macOS and Windows; popular among Mac users. |
| Docker | Runs 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
-
CentOS 7 guides
-
cPanel 20 guides
-
CyberPanel 18 guides
-
Operating Systems 81 guides
-
Juniper Networks 18 guides
-
Control Panels 50 guides
-
Linux 17 guides
-
MySQL 29 guides
-
Network 95 guides
-
Plesk Panel 12 guides
-
Virtual Servers 273 guides
-
SEO 3 guides
-
Cyber Security 8 guides
-
Technology 162 guides
-
VMware 36 guides
-
WordPress 20 guides
-
Artificial Intelligence 22 guides