lodev's php image, base image for lodev-webserver
887
A comprehensive PHP development container for the lodev project, supporting multiple PHP versions and a rich set of extensions and development tools.
The lodev-php image serves as a base image for the lodev-webserver and is a core component of the lodev local development environment manager. It provides a complete PHP-FPM stack with support for multiple PHP versions, making it suitable for a wide range of PHP-based projects from legacy applications to modern frameworks.
Key characteristics:
The image supports the following PHP versions:
All supported PHP versions include the following extensions:
Note: PHP 5.6, 7.0, and 7.1 include
mcrypt. PHP 7.0+ includeapcu-bcfor backward compatibility.
| Variable | Default | Description |
|---|---|---|
LODEV_PHP_VERSION | 8.4 | Active PHP version in the container |
NODE_VERSION | 24 | Node.js version |
PHP_INI | /etc/php/8.4/fpm/php.ini | PHP configuration file path |
COMPOSE_ALLOW_SUPERUSER | 1 | Allow Composer to run as root |
COMPOSER_PROCESS_TIMEOUT | 2000 | Composer process timeout in seconds |
XDEBUG_MODE | off | Xdebug mode (off by default) |
linux/amd64 - x86-64 architecturelinux/arm64 - ARM64 architecture (Apple Silicon, etc.)The lodev-php image is automatically managed through the lodev CLI. When you create a project with lodev:
lodev create --type php
lodev start
The lodev framework handles Docker Compose configuration, volume mounting, and network setup automatically.
For standalone use without lodev:
docker run -d --name php-dev \
-v /path/to/project:/var/www/html \
-p 9000:8080 \
namnh198/lodev-php:latest
Switch PHP versions at runtime inside the container:
# List available PHP versions
ls /usr/bin/php*
# Switch active PHP version
update-alternatives --set php /usr/bin/php8.1
# Verify current version
php --version
Xdebug is installed but disabled by default. To enable/disable Xdebug:
# Enable Xdebug
phpenmod xdebug
# Disable Xdebug
phpdismod xdebug
# Use xdebugctl for command-line control
xdebugctl enable
xdebugctl disable
The active PHP-FPM configuration file is located at:
/etc/php/{LODEV_PHP_VERSION}/fpm/php.ini
The PHP-FPM socket is available at:
/run/php/php-fpm.sock
This image and its source code are licensed under the Apache License 2.0. See LICENSE for details.
Contributions are welcome! Please submit issues and pull requests on the lodev GitHub repository.
Content type
Image
Digest
sha256:0c877972b…
Size
284.5 MB
Last updated
3 months ago
docker pull namnh198/lodev-php