如何在 xampp 7.1.1 中将 php 从 7.1.1 降级到 5.6?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/43086572/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 02:45:37  来源:igfitidea点击:

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

phpxampp

提问by Shiblee Sadik

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

我想在 xampp 7.1.1 中将 php 版本从 7.1.1 降级到 5.6。但我找不到任何选项。 来自 xampp 的 PHP 信息

回答by Lanti

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

我认为在 Xampp 中从 PHP7 到 PHP5 最安全的降级路径是:

  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 phpfolder to php7in Xampp.

  3. Now copy the phpfolder from xampp-win32-5.6.37-0-VC11.zipinto your Xampp install folder.

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

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

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

  1. 这里下载带有 PHP5 的 Xampp 的自打包版本(截至今天,这是xampp-win32-5.6.37-0-VC11.zip)。

  2. 在 Xampp中将php文件夹重命名为php7

  3. 现在将该php文件夹复制xampp-win32-5.6.37-0-VC11.zip到您的 Xampp 安装文件夹中。

  4. \xampp\apache\conf\extra\httpd-xampp.conf文件进行备份。

  5. 也替换此文件xampp-win32-5.6.37-0-VC11.zip

  6. 通过这种方式,配置文件(包括php.ini)具有来自 Xampp 团队的设置。

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

请注意,请下载同时发布的 PHP 5 和 7 Xampp 软件包。

Notify me if I miss something.

如果我错过了什么,请通知我。

回答by Mas

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

如果您想在 xampp 中将 php 从 7.1.1 降级到 5.6,请按照以下步骤操作(对于 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.zipsee the image [image 1][1]
  3. Delete phpfolder and apachefolder present in C:\xampp

  4. Copy phpfolder and apachefolder from extracted file and paste it to C:\xampp

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

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

  1. 转到https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/5.6.36/
  2. 下载并解压文件xampp-win32-5.6.36-0-VC11.zip见图片 [图片 1][1]
  3. 删除C:\xampp 中的php文件夹和apache文件夹

  4. 从提取的文件中复制php文件夹和apache文件夹并将其粘贴到C:\xampp

  5. 在 php 文件夹中的php ini文件中添加\xampp\之前的“ C:” 。

  6. 启动您的 apache 和 MySQL 并检查 php 版本。它将显示php 5.6.36

回答by Arturs Jerjomins

Just delete this xampp, and download 5.6 version.

删除这个xampp,下载5.6版本即可

回答by roundAbout

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.

没有降级 XAMPP 的选项。XAMPP 使用特定的 PHP 版本进行硬编码,以确保所有模块兼容并正常工作。但是,如果您的项目需要 PHP 5.6,您可以安装一个旧版本的 XAMPP,并将 PHP 5.6 打包到其中。

Source: How to downgrade php from 5.5 to 5.3

来源:如何将 php 从 5.5 降级到 5.3

回答by Adi

Change the .htaccess code to switch to PHP 5.6:

更改 .htaccess 代码以切换到 PHP 5.6:

AddHandler application/x-httpd-php56 .php

回答by A mohseni

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.)

XAMPP 是一个集成包,您不能降级或更改其组件之一,例如 php。(您可以使用一些解决方案,但一切正常的可能性很小。)

You can download the package from these links:

您可以从以下链接下载软件包:

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

您最好从 sourceforge.net 下载旧包。

回答by Erroid

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。我已经设法在我的 Xampp PHP 7 版本上使用 PHP 5.6。以下是您需要做的事情才能使其正常工作:

  1. Raname (backup) <XAMPP_DIR>\phpto <XAMPP_DIR>\php~7
  2. Copy (backup) <XAMPP_DIR>\apache\conf\extra\httpd-xampp.confto <XAMPP_DIR>\apache\conf\extra\httpd-xampp~7.conf
  3. Download PHP5and unpack it to <XAMPP_DIR>\php
  4. Edit <XAMPP_DIR>\apache\conf\extra\httpd-xampp.confand change all php5occurrences to php7. You need to change php7apache2_4.dllto php5apache2_4.dll, php7ts.dllto php5ts.dlland php7_moduleto php5_module
  5. Ensure all your paths are correct like extension_dirin php.ini.
  1. 拉名(备份)<XAMPP_DIR>\php<XAMPP_DIR>\php~7
  2. 复制(备份)<XAMPP_DIR>\apache\conf\extra\httpd-xampp.conf<XAMPP_DIR>\apache\conf\extra\httpd-xampp~7.conf
  3. 下载PHP5并解压到<XAMPP_DIR>\php
  4. <XAMPP_DIR>\apache\conf\extra\httpd-xampp.conf将所有php5出现的内容编辑并更改为php7. 您需要更改php7apache2_4.dllphp5apache2_4.dllphp7ts.dllphp5ts.dllphp7_modulephp5_module
  5. 确保所有的路径是正确的像extension_dirphp.ini

Restart Apache and voila.

重新启动 Apache,瞧。

回答by Pure Electricity

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.

我知道可能会迟到,但我只是添加到 Lanti 的答案中,因为它是最受欢迎的,我在评论中遇到了与 Wouter Vanherck 相同的问题,我还不能发表评论。

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

对我有帮助的不仅仅是替换\xampp\apache\conf\extra\httpd-xampp.conf我替换了整个apache文件夹。我基本上对它做了与php文件夹相同的事情(第 2 步和第 3 步)。

Now the error is fixed and Apache starts just fine.

现在错误已修复,Apache 启动正常。

回答by Bilal lilla

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

如果我们想使用多个版本的 php,则使用 WAMP 是 perforce 选项。

回答by Okwo moses

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"

这很容易做到,您需要做的就是 1) 从 [1] 下载 5.6: https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/5.6.36/,运行安装程序并安装在文件夹“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"

2)从[ https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/7.4.2/xampp-portable-windows-x64-7.4.2-0-VC15-installer.exe/download]下载7.6 [1]并在“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

注意:之后,您现在在系统中安装了单独的 xampp。您现在要做的就是将每个 xampp 作为单独的实体运行。如果你想运行 7.6,总是 5.6