- Install latest xampp
- Check installed php version
- Download desired php versions
- In my case, I will add php5.6 version
- Make a folder in xampp root for php5.6 php. For example, php5_6
- Copy downloaded php5.6 files and folders to php5_6
- Open php.ini in php5_6 folder. (if php.ini not exist, rename php.ini-production to php.ini)
- Find and uncomment following lines
extension_dir = “ext”extension=php_bz2.dll
extension=php_curl.dll
extension=php_fileinfo.dll
extension=php_gd2.dll
extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_exif.dll ; Must be after mbstring as it depends on it
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll - Open httpd_xampp.conf and add following. Please check your xampp php path and add desired listen port. Here Listen port is 8056.
ScriptAlias /php5_6/ “C:/xampp/php5_6/”
<Directory “C:/xampp/php5_6”>
AllowOverride None
Options None
Require all denied
<Files “php-cgi.exe”>
Require all granted
</Files>
</Directory>Listen 8056
<VirtualHost *:8056>
UnsetEnv PHPRC
<FilesMatch “\.php$”>
php_flag engine off
SetHandler application/x-httpd-php5_6
Action application/x-httpd-php5_6 “/php5_6/php-cgi.exe”
</FilesMatch>
</VirtualHost> - Check whether the port work with php versions
http://localhost/dashboard/phpinfo.php
http://localhost:8056/dashboard/phpinfo.php
Shaan says
This may be due to a blocked port, missing dependencies