Sign inSign up

aachraf/php-dev-box

By aachraf

•Updated over 1 year ago

Image
0

542

aachraf/php-dev-box repository overview

⁠PHP Core & Extension Development Docker Image

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.

⁠🚀 Quick Start

# 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

⁠🛠️ What's Included

⁠Core Development Environment
  • PHP compiled from source with debug symbols (--enable-debug)
  • PHP source code available at /usr/src/php/src/php-src/
  • ext_skel.php ready for extension skeleton generation
  • Full PHP build environment for core development
⁠Development Tools
  • GDB - GNU Debugger for debugging PHP core and extensions
  • Valgrind - Memory debugging and profiling
  • Zig - Modern systems programming language compiler (v0.14.0)
  • Git, Nano, Vim - Version control and editors
⁠Build Tools
  • GCC/G++ - C/C++ compilers
  • Autoconf/Automake - Build system tools
  • Bison/Flex - Parser generators
  • re2c - Lexer generator

⁠🏗️ Available PHP Versions

TagPHP VersionDescription
latest, 8.4, 8.4.4PHP 8.4.4Latest stable (default)
8.3, 8.3.15PHP 8.3.15Stable release
8.2, 8.2.28PHP 8.2.28LTS release
8.1, 8.1.31PHP 8.1.31Legacy support

⁠📝 Main Command: phpdev

The 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

⁠🎯 Use Cases

⁠PHP Core Development
  • Working on Zend Engine improvements
  • Developing new PHP language features
  • Fixing PHP core bugs and optimizations
  • Adding new SAPIs
⁠PHP Extension Development
  • Creating custom PHP extensions
  • Porting extensions to new PHP versions
  • Debugging extension issues
  • Performance testing extensions

⁠🔧 Custom Extensions

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 .

⁠🌟 Key Features

  • ✅ No 10+ minute PHP compilation - Pre-built and ready
  • ✅ Debug-ready - PHP compiled with debug symbols
  • ✅ Complete toolchain - All build tools included
  • ✅ Multi-version support - PHP 8.1 through 8.4
  • ✅ Professional workflow - Makefile-based development
  • ✅ Modern tools - Includes Zig compiler
  • ✅ Optimized builds - Multi-stage Docker builds for speed

⁠📁 Directory Structure

/opt/php/                   # PHP installation
/usr/src/php/src/php-src/   # PHP source code  
/workdir/                   # Your mounted code
/usr/local/bin/phpdev       # Main development command

⁠🔗 Repository & Documentation

⁠📄 License

MIT License - see LICENSE⁠ for details.


Happy PHP Core & Extension Development! 🚀

Tag summary

Content type

Image

Digest

sha256:551d96388…

Size

485 MB

Last updated

over 1 year ago

docker pull aachraf/php-dev-box