A pre-built Docker image that provides a complete PHP development environment for both PHP core development and PHP extension development with debug symbols, development tools, and the Zig compiler. Eliminates the need for time-consuming PHP compilation by providing a ready-to-use development environment.
# Pull and run the latest image
docker run -v $(pwd):/workdir -it --rm achraf/php-dev-box
# Show available commands and help
docker run --rm achraf/php-dev-box phpdev help
# Create a new PHP extension
docker run -v $(pwd):/workdir -it --rm achraf/php-dev-box phpdev create EXT=myext
--enable-debug)/usr/src/php/src/php-src/| Tag | PHP Version | Description |
|---|---|---|
latest, 8.4, 8.4.4 | PHP 8.4.4 | Latest stable (default) |
8.3, 8.3.15 | PHP 8.3.15 | Stable release |
8.2, 8.2.28 | PHP 8.2.28 | LTS release |
8.1, 8.1.31 | PHP 8.1.31 | Legacy support |
phpdevThe primary development interface:
# Show help and available targets
phpdev help
# Show environment information
phpdev info
# Create a new extension skeleton
phpdev create EXT=myext
# Build extension in current directory
phpdev build
# Run extension tests
phpdev test
# Debug with GDB
phpdev debug
# Memory debugging with Valgrind
phpdev valgrind
Build with additional PHP extensions:
# Build with database extensions
docker build --build-arg ENABLE_EXTENSIONS="--enable-mysqlnd --with-pdo-mysql --with-pdo-pgsql" -t my-php-dev .
# Build with graphics and media
docker build --build-arg ENABLE_EXTENSIONS="--enable-gd --enable-exif" -t my-php-dev .
# Build with full web development stack
docker build --build-arg ENABLE_EXTENSIONS="--enable-mysqlnd --with-pdo-mysql --enable-gd --enable-intl --enable-zip --enable-bcmath" -t my-php-dev .
/opt/php/ # PHP installation
/usr/src/php/src/php-src/ # PHP source code
/workdir/ # Your mounted code
/usr/local/bin/phpdev # Main development command
MIT License - see LICENSE for details.
Happy PHP Core & Extension Development! 🚀
Content type
Image
Digest
sha256:551d96388…
Size
485 MB
Last updated
over 1 year ago
docker pull aachraf/php-dev-box