XAMPP is a free local server that allows you to run PHP and MySQL on your computer. To set it up, download it from apachefriends.org, install it, and start Apache and MySQL from the XAMPP Control Panel. Then place your PHP files in the htdocs
folder (e.g., C:\xampp\htdocs
) and access them via http://localhost/
. You can manage your databases using phpMyAdmin at http://localhost/phpmyadmin/
.
1. Download XAMPP
- Go to the official website:
👉 https://www.apachefriends.org/index.html - Choose the latest version for Windows.
- Click Download.
2. Install XAMPP
- Run the downloaded installer (e.g.,
xampp-windows-x64-8.2.0-0-installer.exe
). - If you get a warning about User Account Control (UAC), click Yes to continue.
Installer Options:
- Select components (keep default selections: Apache, MySQL, PHP, phpMyAdmin).
- Choose the install location (default:
C:\xampp
). - Complete the setup wizard.
3. Start XAMPP
- After installation, open the XAMPP Control Panel.
- Start Apache and MySQL services by clicking their Start buttons.
- A green background means the service is running.
4. Test Local Server
- Open your browser and go to:
http://localhost/
- You should see the XAMPP welcome page.
5. Add Your PHP Projects
- Open the folder:
C:\xampp\htdocs\
- Create a new folder, e.g.,
myproject
- Inside it, create a file
index.php
with:
<?php
echo "Hello from XAMPP!";
?>
- In the browser, go to:
http://localhost/myproject/
6. Access phpMyAdmin (MySQL GUI)
- Open browser:
http://localhost/phpmyadmin/
- Default credentials:
- Username:
root
- Password: (leave blank)
- Username: