34

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

Shiblee Sadik
  • 422
  • 1
  • 5
  • 10
  • I think, that this link explains it very well http://stackoverflow.com/questions/25397219/how-to-downgrade-php-from-5-5-to-5-3 however, you can delete your current instalation and make new one. – janfitz Mar 29 '17 at 07:06
  • It is possible to do what you ask. You can download PHP, and just change your config file to the folder you need. As seen in another SO post [here](https://stackoverflow.com/questions/45790160/is-there-way-to-use-two-php-versions-in-xampp). – Keviin Feb 18 '18 at 13:08
  • 2
    If you want more than one php version with customization use WAMP. – Jaffar Mar 11 '19 at 06:20

13 Answers13

34

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.

Lanti
  • 2,299
  • 2
  • 36
  • 69
18

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

Raza
  • 189
  • 1
  • 4
4

Just delete this xampp, and download 5.6 version.

Aniket Sahrawat
  • 12,410
  • 3
  • 41
  • 67
Arturs
  • 292
  • 3
  • 17
3

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

Community
  • 1
  • 1
  • Actually I want to use xampp latest version but for project purpose I need php version 5.6. Is it possible to downgrade the php version without uninstalling xampp? – Shiblee Sadik Mar 29 '17 at 07:23
  • Simple answer no. You can either run php 5.6 or 7.1.1 It is not possible to run both at the same time but you can install them in same machine. However, the processing will be done by either 5.6 or 7.1.1 –  Mar 29 '17 at 07:28
2

Change the .htaccess code to switch to PHP 5.6:

AddHandler application/x-httpd-php56 .php
Adi
  • 186
  • 9
2

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.

dferenc
  • 7,918
  • 12
  • 41
  • 49
A mohseni
  • 41
  • 3
2

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.

Marcin Majchrzak
  • 662
  • 1
  • 11
  • 22
0

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
</FilesMatch>
0

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.

0

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

Bilal lilla
  • 618
  • 3
  • 8
  • 29
0

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

Okwo moses
  • 85
  • 6
0

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:

https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/

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

Kamlesh
  • 5,233
  • 39
  • 50
-1

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