sample-project is a DDEV-based local development environment for running legacy applications on PHP 5.6 + Apache with a MySQL 8.0 database.
This repository includes:
- A custom database container definition (
.ddev/docker-compose.db.yaml) - An additional PHP service for legacy PHP-FPM 5.6 (
.ddev/docker-compose.php.yaml) - Environment configuration (
.ddev/config.yaml) - Traefik integration
- Custom developer commands in
.ddev/commandsfor database import and export - A minimal application entry point (
index.php)
- DDEV v1.24+
- Docker / Docker CE / WSL2
- PHP 5.6 (Apache)
- MySQL 8.0
- Traefik Router
Before you start, make sure you have:
- Docker Desktop or Docker CE
- WSL2 (Windows only)
- DDEV 1.24 or newer
- ports 80 and 443 available
Note: some software, such as Avast Web Shield, may block port 80.
project/
│── README.md
└── db-backups/
└── db-import/
├── database.sql.zip
├── database.sql
└── htdocs/
├── .htaccess
├── index.php
└── ...
└── .ddev/
├── config.yaml
├── docker-compose.web.yaml
├── web-build/
│ ├── Dockerfile
│ ├── start.sh
│ ├── custom-php.ini
├── apache/
├── mysql/
├── traefik/
├── commands/
└── ...
/htdocs
Contains your website source files (index.php, .htaccess, and any other files that would normally live in public_html). Copy them from your production server and adjust them as needed, for example database credentials or domain-related settings.
/db-backups
Stores database backup files created with the custom ddev db-backups command.
/db-import
Place database dump files here before importing. Supported formats: SQL, GZ, and ZIP.
Set the project name (used as the local domain) in:
.ddev/config.yaml
Default value:
name: php56If you change .ddev/config.yaml, rebuild the containers.
Restart the environment:
ddev restartOr perform a clean reset:
ddev delete
ddev startTo inspect the current project configuration, run:
ddev describeddev startThe project will be available at:
https://sample-project.ddev.site
ddev stopddev poweroffDatabase connection details:
- MySQL version:
8.0 - Host:
db - Port:
3306 - Credentials:
db/dborroot/root
DDEV uses Traefik as a local HTTP/HTTPS router for projects. The Traefik dashboard allows you to inspect which addresses, ports, and services are currently handled by the DDEV router.
The dashboard shows, among other things:
- available entrypoints, such as
:80,:443,:8025,:8026,:8142,:10999, - configured HTTP routers, which define how requests from
.ddev.sitedomains are routed to containers, - HTTP services, which represent the target services/containers receiving the traffic,
- middlewares, which apply additional request-processing rules,
- routing status and possible configuration errors.
Dashboard URL:
http://127.0.0.1:10999
The dashboard is only used to inspect local routing configuration. It is not part of the production application.
If Micro support is configured in this repository, you can open a file with:
ddev micro index.phpCommon causes include:
- Avast Web Shield
- IIS, nginx, or Apache running on Windows
- another Docker container already using the port
Try:
ddev poweroffThen stop or disable the service that is blocking the port.
Check the startup script permissions:
chmod +x .ddev/web-build/start.shAll custom commands are located in:
.ddev/commands/
ddev db-backupsCreates a database backup and saves the dump file in /db-backups/.
ddev db-importLets you choose a database dump file to import. Supported formats: SQL, GZ, and ZIP. Place the file in /db-import/ before running the command.
For easier file searching, install fzf:
sudo apt install fzfMore information is available in the fzf project repository.
MIT










