PHP Installation
Here is a clear and complete guide for PHP Installation on Windows, macOS, and Linux.
✅ PHP Installation Guide
PHP can be installed in three ways:
-
Using XAMPP (Recommended for Beginners)
-
Using WAMP / MAMP / LAMP
-
Installing PHP manually
Below are the steps for each method.
🚀 1. Install PHP Using XAMPP (Beginner Friendly)
XAMPP includes: Apache Server + PHP + MySQL + phpMyAdmin
✔ Steps:
1: Download XAMPP
-
Download XAMPP for Windows / macOS / Linux.
2: Install XAMPP
-
Run the installer
-
Select components (keep default)
3: Start Apache & MySQL
Open XAMPP Control Panel → Start:
-
Apache
-
MySQL
Step 4: Check PHP Version
Open browser and type:
Or open Command Prompt and check:
Step 5: Test PHP File
Create a file:
Add this code:
Open in browser:
2. Install PHP Using WAMP (Windows)
✔ Steps
-
Download WAMP: https://www.wampserver.com
-
Install and Launch
-
Check PHP version:
-
Create projects inside:
3. Install PHP Using MAMP (macOS)
✔ Steps
-
Download MAMP: https://www.mamp.info
-
Install
-
Start Servers (Apache, MySQL)
-
Test PHP:
Your PHP files go inside:
4. Install PHP Using LAMP (Linux)
Ubuntu / Debian
CentOS / Fedora / RHEL
5. Manual Installation of PHP (Advanced Users)
1: Download PHP
-
Windows: https://windows.php.net/download
2: Extract ZIP to:
3: Add PHP to PATH
-
Open System Environment Variables
-
Edit PATH → Add:
4: Test
Open CMD:
6. Verify PHP Installation
Create a test file:
Open in browser:
This shows complete PHP configuration.
Which method should you choose?
| Purpose | Best Option |
|---|---|
| Beginners | ⭐ XAMPP |
| Windows-only development | WAMP |
| macOS users | MAMP |
| Linux users | LAMP |
| Professional Developer | Manual PHP + Composer |
