升级 Xampp 以运行 php 7
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/34296466/
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
Upgrading Xampp to run php 7
提问by Bugfixer
After Reading a couple of question on how to upgrade xampp to newer versions of php. I started upgrading mine to version 7 as I wanted to learn
在阅读了关于如何将 xampp 升级到较新版本的 php 的几个问题之后。我开始将我的升级到版本 7,因为我想学习
strict type hinting
严格类型提示
I downloaded php 7 from officialsite.I copied the content of this downloaded folder to php folder of xampp.but it is not working.I renamed php.ini-development to php.ini.Is there any better way to do this because it is not working.
我从官方网站下载了 php 7。我将此下载文件夹的内容复制到 xampp 的 php 文件夹中。但它不起作用。我将 php.ini-development 重命名为 php.ini。有没有更好的方法可以做到这一点,因为它是不工作。
Please help.
请帮忙。
回答by Abayomi Israel
I consider @camelCase good, but you can also consider trying this method. It may suite your need.
我认为@camelCase 不错,但您也可以考虑尝试这种方法。它可能适合您的需要。
Upgrade to PHP7 in XAMPPBefore proceeding further I will recommend to take backup of your XAMPP configuration. After you have made backup below are some steps to use PHP7 with in your XAMPP
在 XAMPP 中升级到 PHP7 在继续之前,我建议您备份您的 XAMPP 配置。完成备份后,下面是在 XAMPP 中使用 PHP7 的一些步骤
- Download PHP7: Download php7 from php.netwebsite.
- 下载 PHP7:从php.net网站下载 php7。
If your apache is thread safe then download a thread safe version of PHP7 otherwise download NTS i.e non thread safe version.
如果您的 apache 是线程安全的,则下载 PHP7 的线程安全版本,否则下载 NTS,即非线程安全版本。
Place PHP on appropriate place in your XAMPP: Put your PHP7 in your XAMPP. I usually prefer to to put on location /XAMPP/php7 but you can put as per your need. There is no any restriction for putting your new php version in xampp.
Include PHP7 with your apache: In XAMPP, PHP is configured using apache file path [yourxampp/apache/conf/extra/httpd-xampp.conf]. Please open the file add first change all variable path from php7 directory.
将 PHP 放在 XAMPP 中的适当位置:将 PHP7 放在 XAMPP 中。我通常更喜欢放在 /XAMPP/php7 位置,但您可以根据需要放置。将新的 php 版本放入 xampp 没有任何限制。
在 apache 中包含 PHP7:在 XAMPP 中,PHP 使用 apache 文件路径 [yourxampp/apache/conf/extra/httpd-xampp.conf] 进行配置。请打开文件添加首先更改php7目录中的所有变量路径。
Also do not forget to add php7 module using below code
也不要忘记使用下面的代码添加 php7 模块
LoadFile yourxampppath/php7/php7ts.dll
LoadFile yourxampppath/php7/libpq.dll
LoadModule php7_module yourxampppath/php7/php7apache2_4.dll
Make sure to change PHP ini directory for your PHP7
确保为您的 PHP7 更改 PHP ini 目录
<IfModule php7_module>
PHPINIDir "yourxampppath/php7"
</IfModule>
Chechout www.techflirt.com
Chechout www.techflirt.com
回答by camelCase
Not sure if you were able to resolve this, but figured I'd suggest an approach since this question comes up high in Google searches and might benefit others.
不确定你是否能够解决这个问题,但我想我会建议一种方法,因为这个问题在谷歌搜索中出现的频率很高并且可能会让其他人受益。
Apache Friends released a version of XAMPP for Windows, Linux, and OS that supports PHP 7.0.1.
Apache Friends 发布了支持 PHP 7.0.1 的适用于 Windows、Linux 和 OS 的 XAMPP 版本。
From the site:
从网站:
We just released a new version of XAMPP for all platforms with PHP 7.0.1. This version also includes a fixed version of the setup_xampp.bat and test_php.bat scripts for Windows.
我们刚刚发布了适用于 PHP 7.0.1 的所有平台的 XAMPP 新版本。此版本还包括用于 Windows 的 setup_xampp.bat 和 test_php.bat 脚本的固定版本。
It can be downloaded from Apache Friends.
它可以从Apache Friends下载。