Reputation: 422
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.
Upvotes: 34
Views: 209828
Reputation: 6145
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.
Upvotes: 0
Reputation: 2339
I think the most safest downgrade path from PHP7 to PHP5 in Xampp is:
Download a self-packaged version of Xampp with PHP5 from here (as of today this is xampp-win32-5.6.37-0-VC11.zip
).
Rename the php
folder to php7
in Xampp.
Now copy the php
folder from xampp-win32-5.6.37-0-VC11.zip
into your Xampp install folder.
Make a backup from .\xampp\apache\conf\extra\httpd-xampp.conf
file.
Replace this file from xampp-win32-5.6.37-0-VC11.zip
as well.
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.
Upvotes: 34
Reputation: 95
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
Upvotes: 0
Reputation: 658
Using WAMP is perforce option if we want to use more then one version of php.
Upvotes: 0
Reputation: 199
If you want to downgrade php from 7.1.1 to 5.6 in xampp follow the steps(For Windows):-
Delete php folder and apache folder present in C:\xampp
Copy php folder and apache folder from extracted file and paste it to C:\xampp
Add " C: " before \xampp\ to php ini file present in php folder.
Start your apache and MySQL and check php version. It will show php 5.6.36
Upvotes: 19
Reputation: 17
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.
Upvotes: 0
Reputation: 9
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>
Upvotes: 0
Reputation: 21
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
Upvotes: -1
Reputation: 682
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:
<XAMPP_DIR>\php
to <XAMPP_DIR>\php~7
<XAMPP_DIR>\apache\conf\extra\httpd-xampp.conf
to <XAMPP_DIR>\apache\conf\extra\httpd-xampp~7.conf
<XAMPP_DIR>\php
<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
extension_dir
in php.ini
.Restart Apache and voila.
Upvotes: 2
Reputation: 41
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.
Upvotes: 2
Reputation: 523
Change the .htaccess code to switch to PHP 5.6:
AddHandler application/x-httpd-php56 .php
Upvotes: 2
Reputation:
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
Upvotes: 3