Xampp понизить версию php

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

I think, that this link explains it very well stackoverflow.com/questions/25397219/… however, you can delete your current instalation and make new one.

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.

13 Answers 13

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.

I’m glas you mentioned taking a backup, because when I follow these steps, my xampp won’t start anymore (without throwing an error)

What I did was downloaded the up-to-date Xampp versions both for PHP7 and PHP5. So they are released probably at the same time.

Читайте также:  Java log http headers

There’s something else in the apache folder that doesn’t allow the apache to start. Replacing the entire apache folder (MAKE A BACKUP) like Mas’s answer says worked like a charm.

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

Just delete this xampp, and download 5.6 version.

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?

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.

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?

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

Change the .htaccess code to switch to PHP 5.6:

AddHandler application/x-httpd-php56 .php 

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.

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) \php to \php~7
  2. Copy (backup) \apache\conf\extra\httpd-xampp.conf to \apache\conf\extra\httpd-xampp~7.conf
  3. Download PHP5 and unpack it to \php
  4. Edit \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 .

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

 etHandler application/x-lsphp56 

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.

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

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»

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

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.

Источник

How to change PHP version in XAMPP for Windows

Image of PHP 7

Have you ever wondered how to upgrade or downgrade your PHP version in XAMPP without having to install another XAMPP software?, Well i have and from most answers i saw online, the best option was to download an updated version of XAMPP, but looking at it, i knew there had to be a better way so i made some research and was able to figure it out. In this article, i would show you how i changed my PHP version from 7.4.15 to 8.0.19. This is a screenshot of my current PHP version If you don’t know your current PHP version, you can use this link to check it.

STEP 1

PHP non thread safe version

Download the PHP version you want to use, you can find the PHP version you want to download from PHP’s download website for windows, but there is something you need to know before downloading any package, the download for a PHP version exists in 2 types — thread safe and non thread safe. Since you are using PHP with XAMPP, you are going to download the non-thread safe version because there is an apache file it has that would be used to configure XAMPP with PHP. After locating it, download the zip file. If you are running on a 32-bit system, download the non-thread safe version labelled with x86.

STEP 2

Apache file for XAMPP configuration

After you have downloaded it, extract the zip file and rename the extracted folder to «php», open the folder to find the apache file i mentioned in step 1 as shown in the image below. Once you have seen it, move the php folder to your xampp folder. Remember to make sure the current php folder in the XAMPP folder is either removed or renamed to something else so that the name won’t conflict with the one you are moving.

STEP 3

After moving the php folder into the XAMPP folder, open the folder and look for the php.ini config file. Whenever you download a PHP package, the php.ini file comes in two parts, php.ini-development and php.ini-production. These two config files represent the settings running on your development and production environments. Since you are using XAMPP, you would be using the development config file, so rename that config file to php.ini.

STEP 4

Open your XAMPP control panel. Under the actions option for Apache, look for the config button, click on it and select the Apache (httpd-xampp.conf) config file to open it. This is the file that XAMPP uses to configure PHP properly, look for the following:

LoadFile "C:/xampp/php/php7ts.dll" LoadModule php7_module "C:/xampp/php/php7apache2_4.dll" 

NOTE — Search everywhere in the file for «php7_module» and change it to «php_module» as you might need to change it in some places.

STEP 5

After you have done all this, save the changes and restart your server, go back to this url and confirm that your PHP version has changed. if everything was done correctly, you should see that you have successfully changed your PHP version!

PHP version 8 image

Very easy and convenient. You can agree it is really not difficult to change your PHP version in XAMPP as it is quite simple to do. Connect with me on twitter and linkedin to find out more about me and my work.

Источник

XAMPP change PHP version

I am working on an older project that uses functions not supported by the newer PHP version included in my version of XAMPP. I want to temporarily change to an older version of PHP, so I’m looking for a way to switch between PHP versions in XAMPP. Unfortunately, refactoring to use the newer version of PHP is not an option.

I know this isn’t helpful, and you don’t want me to say this, but I’m going to do it anyway: If a function is deprecated, in most cases there were good reasons for doing so. For some cases there are scripts out there to help you replace all the calls to deprecated functions out there, and switching back to an older php version is only going to solve your problem once, on 1 machine. That just doesn’t feel right to me

I know what you mean, but sometimes the client just isnt willing to pay much. And I know wamp offers seemless php version switch, was hoping xampp did too. dont use wamp since xampp is (arguably) in many cases more reliable and «professional».

5 Answers 5

I would not dare to ‘temporarily’ shift my development machine.

I would suggest installing a virtual machine manager like VirtualBox and then install a older version of XAMPP in there.

I am really disappointed with the responses on this.

WAMP allows you to switch between PHP and MySQL versions pretty easily.

I did following steps on Windows:

  1. Download your XAMPP with your desired PHP version (the VC-11.zip version)
  2. Unzip on C:/xamppXXXX/ (XXXX -> Your PHP version, for example), so you’ll have both C:/xampp/ (your first installed version) and the new.

3a. Find in all .conf, .ini, .bat files from the xamppXXXX folder /xampp/ and replace for C:/xamppXXXX/. You can use any IDE like SublimeText to find the string.

3b. Find in all .conf files from the xamppXXXX folder \xampp\ and replace for \xamppXXXX\

  1. You can start MySQL from your installed version control panel and open the C:/xamppXXXX/xampp-control.exe and launch Apache from this one.

I did this with php7 installed and php5 from zip and working fine. Opening different instances of XAMPP Control Panel is the best way to have all databases together and not losing them between versions.

Источник

Оцените статью