XAMPP equivalent — ready to use, zero configuration.
Apache 2.4 · PHP 7.4 · MariaDB 10.6 · phpMyAdmin · Portainer
Download and install Docker Desktop for your system.
Windows: Docker Desktop automatically installs everything it needs (including WSL2). Restart if prompted.
Option A — Without Git (beginners)
- On this page, click the green
<> Codebutton (top right) - Click
Download ZIP - Open the downloaded ZIP file
- Extract (unzip) the folder to your Desktop
- Name the folder
PHPenv
Option B — With Git
cd ~/Desktop
git clone https://github.com/selinachegg/php-docker-environment.git PHPenvLauncher (recommended) — An interactive menu to manage everything:
| System | Command |
|---|---|
| Windows | Double-click launcher.bat |
| macOS | Double-click launcher.command |
The launcher lets you start, stop, restart the environment and reset Portainer from a single menu.
Individual scripts (start.bat, stop.bat, start.command, stop.command) remain available for manual use.
The first launch takes 5 to 10 minutes (downloading images). After that: ~10 seconds.
| Service | URL | Description |
|---|---|---|
| 🌐 PHP Site | localhost:8080 | Your PHP files (htdocs/ folder) |
| 🗄️ phpMyAdmin | localhost:8081 | Visual database management |
| 🐳 Portainer | localhost:9000 | Visual Docker container management |
| 🏠 Dashboard | localhost:8082 | Home page with all links |
Your PHP files go in the htdocs/ folder. Changes are instant — no restart needed.
<?php
// htdocs/hello.php → http://localhost:8080/hello.php
echo "Hello world!";
?><?php
$pdo = new PDO(
"mysql:host=db;dbname=app;charset=utf8mb4",
"app", // username
"app" // password
);
?>| Parameter | Value |
|---|---|
| Host | db |
| Database | app |
| Username | app |
| Password | app |
| Root password | root |
Open the Interactive tutorial (HTML) in your browser for the complete step-by-step guide (Mac and Windows).
PDF versions are also available in the tutorials/ folder:
| Problem | Solution |
|---|---|
| Portainer shows "timeout" | Use Reset Portainer in the launcher, or: Windows reset-portainer.bat / macOS docker compose restart portainer. Then go to localhost:9000 immediately. |
| Docker is not running | Open Docker Desktop, wait for the green whale icon, then run the script again. |
| localhost:8080 not responding | Wait 30 seconds (database starts last) then refresh (F5). |
| phpMyAdmin connection error | MariaDB takes 10-20s to start. Wait and refresh. |
| [macOS] "Permission denied" | chmod +x launcher.command start.command stop.command |
| [Win] start.bat closes instantly | Right-click → "Run as administrator" |
| Full reset | docker compose down -v then run the script again |
- PHP 7.4 — PDO, MySQLi, GD, ZIP, MBString, OPcache
- Apache 2.4 — mod_rewrite enabled
- MariaDB 10.6 — 100% MySQL compatible
- phpMyAdmin 5.2
- Portainer Community Edition
