如何在 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
How to downgrade php from 7.1.1 to 5.6 in xampp 7.1.1?
提问by Shiblee Sadik
回答by Lanti
I think the most safest downgrade path from PHP7 to PHP5 in Xampp is:
我认为在 Xampp 中从 PHP7 到 PHP5 最安全的降级路径是:
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 tophp7
in Xampp.Now copy the
php
folder fromxampp-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.
从这里下载带有 PHP5 的 Xampp 的自打包版本(截至今天,这是
xampp-win32-5.6.37-0-VC11.zip
)。在 Xampp中将
php
文件夹重命名为php7
。现在将该
php
文件夹复制xampp-win32-5.6.37-0-VC11.zip
到您的 Xampp 安装文件夹中。从
\xampp\apache\conf\extra\httpd-xampp.conf
文件进行备份。也替换此文件
xampp-win32-5.6.37-0-VC11.zip
。通过这种方式,配置文件(包括
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):-
- Go to https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/5.6.36/
- Download and extract the file xampp-win32-5.6.36-0-VC11.zipsee the image [image 1][1]
Delete phpfolder and apachefolder present in C:\xampp
Copy phpfolder and apachefolder from extracted file and paste it to C:\xampp
Add " C:" before \xampp\ to php inifile present in php folder.
Start your apache and MySQL and check php version. It will show php 5.6.36
- 转到https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/5.6.36/
- 下载并解压文件xampp-win32-5.6.36-0-VC11.zip见图片 [图片 1][1]
删除C:\xampp 中的php文件夹和apache文件夹
从提取的文件中复制php文件夹和apache文件夹并将其粘贴到C:\xampp
在 php 文件夹中的php ini文件中添加\xampp\之前的“ C:” 。
启动您的 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 打包到其中。
回答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。以下是您需要做的事情才能使其正常工作:
- Raname (backup)
<XAMPP_DIR>\php
to<XAMPP_DIR>\php~7
- Copy (backup)
<XAMPP_DIR>\apache\conf\extra\httpd-xampp.conf
to<XAMPP_DIR>\apache\conf\extra\httpd-xampp~7.conf
- Download PHP5and unpack it to
<XAMPP_DIR>\php
- Edit
<XAMPP_DIR>\apache\conf\extra\httpd-xampp.conf
and change allphp5
occurrences tophp7
. You need to changephp7apache2_4.dll
tophp5apache2_4.dll
,php7ts.dll
tophp5ts.dll
andphp7_module
tophp5_module
- Ensure all your paths are correct like
extension_dir
inphp.ini
.
- 拉名(备份)
<XAMPP_DIR>\php
到<XAMPP_DIR>\php~7
- 复制(备份)
<XAMPP_DIR>\apache\conf\extra\httpd-xampp.conf
到<XAMPP_DIR>\apache\conf\extra\httpd-xampp~7.conf
- 下载PHP5并解压到
<XAMPP_DIR>\php
<XAMPP_DIR>\apache\conf\extra\httpd-xampp.conf
将所有php5
出现的内容编辑并更改为php7
. 您需要更改php7apache2_4.dll
到php5apache2_4.dll
,php7ts.dll
要php5ts.dll
与php7_module
以php5_module
- 确保所有的路径是正确的像
extension_dir
在php.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.conf
I replaced the whole apache
folder. I basically did the same thing with it as with the php
folder (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