Skip to content

Instantly share code, notes, and snippets.

View Molkobain's full-sized avatar
🪐

Molkobain Molkobain

🪐
View GitHub Profile
@Molkobain
Molkobain / php-versions-through-url.conf
Last active January 23, 2024 12:56
Apache 2.4 - Switch PHP versions through URL prefix
##########################################################################################################################
#
# Define which version of PHP to run based on the URL, this allows to use different PHP versions on a same project
# It also allows to use different projects with different PHP versions at the same time
#
# Example 1: https://localhost/php74/my-project will run on PHP 7.4
# https://localhost/php82/my-project will run on PHP 8.2 even though the sources are in the same folder
#
# Prerequisites:
# - Apache 2.4+