Skip to content

Instantly share code, notes, and snippets.

@iyank4
Created March 12, 2014 06:54
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 iyank4/9502112 to your computer and use it in GitHub Desktop.
Save iyank4/9502112 to your computer and use it in GitHub Desktop.
XAMPP multi php setup, place PHP folder to php52, php53, php54 and php55
# here: Listen 80
<VirtualHost localhost:80>
ServerName localhost
DocumentRoot "C:/webserver"
</VirtualHost>
<VirtualHost php52.local:80>
ServerName php52.local
DocumentRoot "C:/webserver"
ScriptAlias /php52/ "C:/xampp/php52/"
<FilesMatch "\.php$">
SetHandler None
</FilesMatch>
<Directory "C:/xampp/php52">
AllowOverride None
Options None
Require all denied
<Files "php-cgi.exe">
Require all granted
</Files>
</Directory>
<Directory "C:/webserver">
SetEnv PHPRC "C:/xampp/php52"
SetEnv PHP_PEAR_SYSCONF_DIR "C:/xampp/php52"
SetEnv MIBDIRS "C:/xampp/php52/extras/mibs"
AddHandler php52 .php
Action php52 "/php52/php-cgi.exe"
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
<VirtualHost php53.local:80>
ServerName php53.local
DocumentRoot "C:/webserver"
ScriptAlias /php53/ "C:/xampp/php53/"
<FilesMatch "\.php$">
SetHandler None
</FilesMatch>
<Directory "C:/xampp/php53">
AllowOverride None
Options None
Require all denied
<Files "php-cgi.exe">
Require all granted
</Files>
</Directory>
<Directory "C:/webserver">
SetEnv PHPRC "C:/xampp/php53"
SetEnv PHP_PEAR_SYSCONF_DIR "C:/xampp/php53"
AddHandler php53 .php
Action php53 "/php53/php-cgi.exe"
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
<VirtualHost php54.local:80>
ServerName php54.local
DocumentRoot "C:/webserver"
ScriptAlias /php54/ "C:/xampp/php54/"
<FilesMatch "\.php$">
SetHandler None
</FilesMatch>
<Directory "C:/xampp/php54">
AllowOverride None
Options None
Require all denied
<Files "php-cgi.exe">
Require all granted
</Files>
</Directory>
<Directory "C:/webserver">
SetEnv PHPRC "C:/xampp/php54"
SetEnv PHP_PEAR_SYSCONF_DIR "C:/xampp/php54"
AddHandler php54 .php
Action php54 "/php54/php-cgi.exe"
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
<VirtualHost php55.local:80>
ServerName php55.local
DocumentRoot "C:/webserver"
ScriptAlias /php55/ "C:/xampp/php55/"
<FilesMatch "\.php$">
SetHandler None
</FilesMatch>
<Directory "C:/xampp/php55">
AllowOverride None
Options None
Require all denied
<Files "php-cgi.exe">
Require all granted
</Files>
</Directory>
<Directory "C:/webserver">
SetEnv PHPRC "C:/xampp/php55"
SetEnv PHP_PEAR_SYSCONF_DIR "C:/xampp/php55"
SetEnv MIBDIRS "C:/xampp/php55/extras/mibs"
AddHandler php55 .php
Action php55 "/php55/php-cgi.exe"
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
#
# XAMPP settings
#
# => Comment the related php value
<IfModule env_module>
#SetEnv MIBDIRS "C:/xampp/php/extras/mibs"
#SetEnv MYSQL_HOME "\\xampp\\mysql\\bin"
SetEnv OPENSSL_CONF "C:/xampp/apache/bin/openssl.cnf"
#SetEnv PHP_PEAR_SYSCONF_DIR "C:/xampp/php"
#SetEnv PHPRC "C:/xampp/php54"
SetEnv TMP "C:/xampp/tmp"
SetEnv TMPDIR "C:/xampp/tmp"
</IfModule>
#
# PHP-Module setup
#
# => Change the folder
LoadFile "C:/xampp/php54/php5ts.dll"
LoadFile "C:/xampp/php54/libpq.dll"
LoadModule php5_module "C:/xampp/php54/php5apache2_4.dll"
<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>
#
# PHP-CGI setup
#
#<FilesMatch "\.php$">
# SetHandler application/x-httpd-php-cgi
#</FilesMatch>
#<IfModule actions_module>
# Action application/x-httpd-php-cgi "/php-cgi/php-cgi.exe"
#</IfModule>
<IfModule php5_module>
PHPINIDir "C:/xampp/php54"
</IfModule>
# => The rest is default xampp value
<IfModule mime_module>
AddType text/html .php .phps
</IfModule>
#ScriptAlias /php-cgi/ "C:/xampp/php/"
#<Directory "C:/xampp/php">
# AllowOverride None
# Options None
# Require all denied
# <Files "php-cgi.exe">
# Require all granted
# </Files>
#</Directory>
<Directory "C:/xampp/cgi-bin">
<FilesMatch "\.php$">
SetHandler cgi-script
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler None
</FilesMatch>
</Directory>
<Directory "C:/xampp/htdocs/xampp">
<IfModule php5_module>
<Files "status.php">
php_admin_flag safe_mode off
</Files>
</IfModule>
AllowOverride AuthConfig
</Directory>
<IfModule alias_module>
Alias /security "C:/xampp/security/htdocs/"
<Directory "C:/xampp/security/htdocs">
<IfModule php5_module>
<Files "xamppsecurity.php">
php_admin_flag safe_mode off
</Files>
</IfModule>
AllowOverride AuthConfig
Require all granted
</Directory>
Alias /licenses "C:/xampp/licenses/"
<Directory "C:/xampp/licenses">
Options +Indexes
<IfModule autoindex_color_module>
DirectoryIndexTextColor "#000000"
DirectoryIndexBGColor "#f8e8a0"
DirectoryIndexLinkColor "#bb3902"
DirectoryIndexVLinkColor "#bb3902"
DirectoryIndexALinkColor "#bb3902"
</IfModule>
Require all granted
</Directory>
Alias /phpmyadmin "C:/xampp/phpMyAdmin/"
<Directory "C:/xampp/phpMyAdmin">
AllowOverride AuthConfig
Require all granted
</Directory>
Alias /webalizer "C:/xampp/webalizer/"
<Directory "C:/xampp/webalizer">
<IfModule php5_module>
<Files "webalizer.php">
php_admin_flag safe_mode off
</Files>
</IfModule>
AllowOverride AuthConfig
Require all granted
</Directory>
</IfModule>
#
# New XAMPP security concept
#
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
Require local
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment