Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Legacy Scanner TUI

DDEV Environment for Legacy PHP 5.6 Projects

DDEV Docker PHP 5.6 MySQL 8.0 License version

Overview

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/commands for database import and export
  • A minimal application entry point (index.php)

Tech Stack

  • DDEV v1.24+
  • Docker / Docker CE / WSL2
  • PHP 5.6 (Apache)
  • MySQL 8.0
  • Traefik Router

Requirements

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 Structure

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.

database backup files

/db-import
Place database dump files here before importing. Supported formats: SQL, GZ, and ZIP.

database import files

Getting Started

Change the project name (optional)

Set the project name (used as the local domain) in:

.ddev/config.yaml

Default value:

name: php56

If you change .ddev/config.yaml, rebuild the containers.

Restart the environment:

ddev restart

Or perform a clean reset:

ddev delete
ddev start

To inspect the current project configuration, run:

ddev describe

ddev describe

Start the environment

ddev start

ddev start

The project will be available at:

https://sample-project.ddev.site

Stop the environment

ddev stop

Shut down all DDEV containers

ddev poweroff

Database

Database connection details:

  • MySQL version: 8.0
  • Host: db
  • Port: 3306
  • Credentials: db/db or root/root

Traefik dashboard

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.

database backup files

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.site domains 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.

Using the Micro Editor Inside DDEV

If Micro support is configured in this repository, you can open a file with:

ddev micro index.php

Troubleshooting

Port 80 is already in use

Common causes include:

  • Avast Web Shield
  • IIS, nginx, or Apache running on Windows
  • another Docker container already using the port

Try:

ddev poweroff

Then stop or disable the service that is blocking the port.

The web container exits immediately

Check the startup script permissions:

chmod +x .ddev/web-build/start.sh

Development Commands

All custom commands are located in:

.ddev/commands/

Available commands

ddev db-backups

Creates a database backup and saves the dump file in /db-backups/.

Backup database

ddev db-import

Lets you choose a database dump file to import. Supported formats: SQL, GZ, and ZIP. Place the file in /db-import/ before running the command.

Import database - files list

Import database - confirm selected file

Import database - complete

Extra Tips

For easier file searching, install fzf:

sudo apt install fzf

More information is available in the fzf project repository.

fzf

License

MIT

About

The repository provides a ready-to-use DDEV environment for running and maintaining legacy PHP 5.6 applications with Apache and MySQL 8.0, along with simple tools for database import and backup.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages