Enable Laradock to run multiple PHP versions simultaneously
- Support running multiple PHP versions simultaneously
- No impact on Laradock updates (only modified one original Laradock file)
Clone this project to your Laradock root directory:
git clone git@github.com:slowlyo/laradock-multi-version.git {your Laradock directory}/.laradock-multi-versionAdd the following configuration to your Laradock's docker-compose.yml file:
# Note: Must be placed at the first line of Laradock docker-compose.yml file
include:
- .laradock-multi-version/docker-compose.ymlUse docker compose command to start the required services:
# Example: Start PHP 7.4, PHP 8.0
# Execute in Laradock directory
docker compose up -d php-fpm-74 workspace-74 php-fpm-80 workspace-80 ...location ~ \.php$ {
# ...
- fastcgi_pass php-fpm:9000;
+ fastcgi_pass php-fpm-80:9000;
# ...
}