
A Docker Compose environment for local PHP development — supporting PHP 5.6 through 8.5
Hi everyone!
I’d like to share docker-compose-php, an open-source Docker environment that I originally created seven years ago and still actively maintain and use in my daily work.
Its main purpose is to make it easy to run multiple local PHP projects—even projects that require different PHP versions—without installing PHP, a web server, or a database directly on your machine.
Key features:
- PHP versions from 5.6 through 8.5
- PHP-FPM with Nginx or Apache with mod_php
- Multiple local domains using different PHP versions
- Automated configuration through a Python management script
- HTTP and HTTPS support with automatic self-signed certificate generation
- Mailpit for testing outgoing emails
- Adminer for database management
- MariaDB, optional Node.js tooling, MyCLI, and MySQLTuner
- Makefile commands for common operations
- Optional Unix socket communication between Nginx and PHP-FPM
Repository: https://github.com/rhamdeew/docker-compose-php
I’d appreciate any feedback, feature suggestions, bug reports, or contributions. I’m especially interested in hearing how other developers manage local environments for projects that still depend on older PHP versions.