Skip to content

johnywind/dockserver-multiphp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dockserver-multiphp

based on https://github.com/leymannx/apache-multiphp

Debian 9 - Apache 2.4 - PHP 5.6, PHP 7.1 and PHP 7.2

Build the docker image: docker build -t dockserver-multiphp .

  1. $ docker run -p 8856:8856 -p 8871:8871 -p 8872:8872 [-v c:/xampp/htdocs:/var/www] dockserver-multiphp
  2. In your browser visit
  3. Break stuff! :)

Magento

I use this image to test Magento (and others) on different PHP versions

Following tools will also be provided:

  • Composer
  • npm
  • ssh access (default root/root)

For more info see Dockerix on GitHub.

Multiple PHP versions in parallel

This image uses Apache's mod_proxy_fcgi and loads the right PHP version with ProxyPassMatch. You don't have to do anyting as I already incorporated into Apache's 000-default.conf:

Listen 8856
Listen 8871
Listen 8872

<VirtualHost *:8856>

    ServerName localhost
	ServerAdmin webmaster@localhost
	DocumentRoot /var/www/php56

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined

	ProxyPassMatch "^/(.*\.php(/.*)?)$" "unix:/var/run/php/php5.6-fpm.sock|fcgi://localhost/var/www/php56"
	<Directory "/var/www/php56">
		Order allow,deny
		Allow from all
		AllowOverride FileInfo All
		Require all granted
	</Directory>

</VirtualHost>

<VirtualHost *:8871>
	
    ServerName localhost
	ServerAdmin webmaster@localhost
	DocumentRoot /var/www/php71

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined

	ProxyPassMatch "^/(.*\.php(/.*)?)$" "unix:/var/run/php/php7.1-fpm.sock|fcgi://localhost/var/www/php71"
	<Directory "/var/www/php71">
		Order allow,deny
		Allow from all
		AllowOverride FileInfo All
		Require all granted
	</Directory>

</VirtualHost>
....etc :)

About

Docker base image to run multiple PHP versions in parallel. Optimised for Magento 2

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dockerfile 98.0%
  • Shell 2.0%