[php] How to downgrade php from 7.1.1 to 5.6 in xampp 7.1.1?

I want to downgrade php version from 7.1.1 to 5.6 in xampp 7.1.1. But I can't find any option. PHP info from xampp

This question is related to php xampp

The answer is

XAMPP is an integrated package and you can not downgrade or change one of its component such as php. (There are some solutions that you can use but there is little chances that everything work fine.)

You can download the package from these links:

You had better to download the old package form sourceforge.net.

There is no option to downgrade XAMPP. XAMPP is hardcoded with specific PHP version to make sure all the modules are compatible and working properly. However if your project needs PHP 5.6, you can just install a older version of XAMPP with PHP 5.6 packaged into it.

Source: How to downgrade php from 5.5 to 5.3

I think the most safest downgrade path from PHP7 to PHP5 in Xampp is:

  1. Download a self-packaged version of Xampp with PHP5 from here (as of today this is xampp-win32-5.6.37-0-VC11.zip).

  2. Rename the php folder to php7 in Xampp.

  3. Now copy the php folder from xampp-win32-5.6.37-0-VC11.zip into your Xampp install folder.

  4. Make a backup from .\xampp\apache\conf\extra\httpd-xampp.conf file.

  5. Replace this file from xampp-win32-5.6.37-0-VC11.zip as well.

  6. This way the config files (including php.ini) has settings from the Xampp team.

  • Before any changes, to verify changed Apache configs, you can compare both Xampp release folder at .\xampp\apache\conf with tools like Meld.

  • I should note that please download PHP 5 and 7 Xampp packages released at the same time.

Notify me if I miss something.

If you want to downgrade php version, just simply edit yout .htaccess file. Like you want to downgrade any php version to 5.6, just add this into .htaccess file

<FilesMatch "\.(php4|php5|php7|php3|php2|php|phtml)$">  
etHandler application/x-lsphp56

It is very easy to do, all you need to do is 1) download 5.6 from [1]: https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/5.6.36/, the run the setup and install in folder "xampp"

2) download 7.6 from [https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/7.4.2/xampp-portable-windows-x64-7.4.2-0-VC15-installer.exe/download][1] and run the setup in "xampp2"

NOte: after that you now have separate xampp installed in your system. all you do now is to run each xampp as a separate entity. Alway quite the 5.6 if you want to run 7.6

Change the .htaccess code to switch to PHP 5.6:

AddHandler application/x-httpd-php56 .php

This solution is Only for local system / localhost on windows:

The simplest way to install xampp 5.6.X version as per your requirement in other windows drive then run xampp 5.6.X services from it's control panel for php 5.6 version.

NOTE: If you already have xampp (any other version) on your system then please close that xampp's services then start xampp 5.6.x services otherwise this solution will not work.

You can download your required (xampp 5.6 as per question) xampp version from below link:


I have used this solution many times, it worked like charm. I hope this will also help you. Thank you to ask this question.

Using WAMP is perforce option if we want to use more then one version of php.

Just delete this xampp, and download 5.6 version.

i was trying the same, so i downloaded the .7zip version of XAMPP with php 5.6.33 from https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/5.6.33/

then followed the steps below: 1. rename c:\xampp\php to c:\xampp\php7 2. raname C:\xampp\apache\conf\extra\httpd-xampp.conf to httpd-xampp7.OLD 3. copy php folder from XAMPP_5.6 7zip archive to c:\xampp\ 4. copy file httpd-xampp.conf from XAMPP_5.6 7zip archive to C:\xampp\apache\conf\extra\

open xampp control panel and start Apache and then visit ( i am using port 82 instead of default 80) http://localhost and then click PHPInfo to see if it is working as expected.

Opening localhost shows dashboard

Opening phpinfo shows version 5.6

If you want to downgrade php from 7.1.1 to 5.6 in xampp follow the steps(For Windows):-

  1. Go to https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/5.6.36/
  2. Download and extract the file xampp-win32-5.6.36-0-VC11.zip see the image [image 1][1]
  3. Delete php folder and apache folder present in C:\xampp

  4. Copy php folder and apache folder from extracted file and paste it to C:\xampp

  5. Add " C: " before \xampp\ to php ini file present in php folder.

  6. Start your apache and MySQL and check php version. It will show php 5.6.36

You do not have to install another version of Xampp. I've managed to use PHP 5.6 on my Xampp PHP 7 version. Here is what you need to do to make it works:

  1. Raname (backup) <XAMPP_DIR>\php to <XAMPP_DIR>\php~7
  2. Copy (backup) <XAMPP_DIR>\apache\conf\extra\httpd-xampp.conf to <XAMPP_DIR>\apache\conf\extra\httpd-xampp~7.conf
  3. Download PHP5 and unpack it to <XAMPP_DIR>\php
  4. Edit <XAMPP_DIR>\apache\conf\extra\httpd-xampp.conf and change all php5 occurrences to php7. You need to change php7apache2_4.dll to php5apache2_4.dll, php7ts.dll to php5ts.dll and php7_module to php5_module
  5. Ensure all your paths are correct like extension_dir in php.ini.

Restart Apache and voila.

I know it might be late but I'm just adding to Lanti's answer since it's the most popular, I had the same problem as Wouter Vanherck in the comments and I can't comment yet.

What helped for me was instead of just replacing \xampp\apache\conf\extra\httpd-xampp.conf I replaced the whole apache folder. I basically did the same thing with it as with the php folder (steps 2 and 3).

Now the error is fixed and Apache starts just fine.