Skip to content

Instantly share code, notes, and snippets.

@pankpan
Last active June 1, 2021 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pankpan/1dcb28b33b42cbea67162650323b45d7 to your computer and use it in GitHub Desktop.
Save pankpan/1dcb28b33b42cbea67162650323b45d7 to your computer and use it in GitHub Desktop.
Multi-PHP version on the same server
<VirtualHost *:80>
DocumentRoot "/var/www/php56"
ServerName php56.local
ErrorLog "logs/php56_error_log"
CustomLog "logs/php56_access_log" combined
<FilesMatch \.php$>
setHandler "proxy:unix:/var/opt/remi/php56/run/php-fpm/www.sock|fcgi://localhost"
</FilesMatch>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/var/www/php74"
ServerName php74.local
ErrorLog "logs/php74_error_log"
CustomLog "logs/php74_access_log" combined
<FilesMatch \.php$>
setHandler "proxy:unix:/var/opt/remi/php74/run/php-fpm/www.sock|fcgi://localhost"
</FilesMatch>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/var/www/php80"
ServerName php80.local
ErrorLog "logs/php80_error_log"
CustomLog "logs/php80_access_log" combined
<FilesMatch \.php$>
setHandler "proxy:unix:/var/opt/remi/php80/run/php-fpm/www.sock|fcgi://localhost"
</FilesMatch>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment