如何在 wamp 服务器中安全地升级 php 版本
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31804864/
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 upgrade safely php version in wamp server
提问by Srini
I downloaded latest wamp server and I installed in my system with php version 5.5.12 and now I want to upgrade php version to 5.5.27 with safely.. How can I upgrade?
我下载了最新的 wamp 服务器,并在我的系统中安装了 php 版本 5.5.12,现在我想安全地将 php 版本升级到 5.5.27。我该如何升级?
回答by Adam ?ipicky
For someone who need to update the PHP version in WAMP, I can recommend this http://wampserver.aviatechno.net/
对于需要在 WAMP 中更新 PHP 版本的人,我可以推荐这个http://wampserver.aviatechno.net/
I had a problems with updating too, but on this website are Wampserver addons like new php version (php 7.1.4 etc.) And you don't have to manually edit files like php.ini or phpForApache.
我也有更新问题,但在这个网站上有 Wampserver 插件,如新的 php 版本(php 7.1.4 等),而且您不必手动编辑文件,如 php.ini 或 phpForApache。
Enjoy!
享受!
回答by Kapil Sharma
WAMP server generally provide addond for different php/mysql versions. However you mentioned you have downloaded latest wamp server. As of now, latest Wamp server v2.5 provide PHP version 5.5.12
WAMP 服务器通常为不同的 php/mysql 版本提供插件。但是你提到你已经下载了最新的 wamp 服务器。截至目前,最新的 Wamp server v2.5 提供 PHP 版本 5.5.12
So you need to upgrade it manually as follow:
所以你需要手动升级它,如下所示:
- Download binaries on php.net
- Extract all files in a new folder : C:/wamp/bin/php/php5.5.27/
- Copy the wampserver.conf from another php folder (like php/php5.5.12/) to the new folder
- Rename php.ini-development file to phpForApache.ini
- Done ! Restart WampServer (>Right Mouseclick on trayicon >Exit)
- 在 php.net 上下载二进制文件
- 提取新文件夹中的所有文件:C:/wamp/bin/php/php5.5.27/
- 将 wampserver.conf 从另一个 php 文件夹(如 php/php5.5.12/)复制到新文件夹
- 将 php.ini-development 文件重命名为 phpForApache.ini
- 完毕 !重新启动 WampServer(> 在托盘图标上单击鼠标右键 > 退出)
Although not asked, I'd recommend to vagrant/puppet or docker for local development. Check puphpet.com for details. It has slight learning curve but it will give you much better control of different versions of every tool.
虽然没有被问到,但我建议使用 vagrant/puppet 或 docker 进行本地开发。查看 puphpet.com 了解详情。它有轻微的学习曲线,但它会让你更好地控制每个工具的不同版本。
回答by hcammidge
To add to the above answer (do steps 1-5).
添加到上述答案(执行步骤 1-5)。
- Click on WAMP -> Select PHP -> Versions: Select the new version installed
- Check that your PATH folder is updated to new path to PHP so your OS has same PHP version of WAMP.
- 点击WAMP -> Select PHP -> Versions:选择安装的新版本
- 检查您的 PATH 文件夹是否已更新为 PHP 的新路径,以便您的操作系统具有相同的 WAMP 的 PHP 版本。
回答by Klaus
One important step is missing in all answers. I successfully upgraded with following steps:
所有答案都缺少一个重要的步骤。我通过以下步骤成功升级:
- stop apache service with wamp stack manager.
- rename your wampstack/php dir to wampstack/php_old
- copy new php dir to wampstack/
- replace wampstack/php/php.ini by wampstack/php_old/php.ini
- test and fix any error with php -v (for example missing extensions)
- [optional] update php version in wampstack/properties.ini
- Replace wampstack/apache/bin/php7ts.dll by wampstack/php/php7ts.dll
- This is not mentioned in the other answers but you need this to use the right php version in apache!
- start apache service
- 使用 wamp 堆栈管理器停止 apache 服务。
- 将您的 wampstack/php 目录重命名为 wampstack/php_old
- 将新的 php 目录复制到 wampstack/
- 用 wampstack/php_old/php.ini 替换 wampstack/php/php.ini
- 使用 php -v 测试并修复任何错误(例如缺少扩展名)
- [可选] 在 wampstack/properties.ini 中更新 php 版本
- 用 wampstack/php/php7ts.dll 替换 wampstack/apache/bin/php7ts.dll
- 其他答案中没有提到这一点,但您需要它才能在 apache 中使用正确的 php 版本!
- 启动apache服务
回答by Junaid Anwar
- Simply Download the PHP version that you want from this url: http://wampserver.aviatechno.net/
- Goto your
wamp\bin\php
directory and extract it like this(Note: you need to rename your folder to phpversionOfPhp
- Start wamp and click wamp icon and choose the version of php you want to use: https://gyazo.com/de5727d7e254795e238422783dec3758
- 只需从此网址下载所需的 PHP 版本:http: //wampserver.aviatechno.net/
- 转到您的
wamp\bin\php
目录并像这样解压缩(注意:您需要将文件夹重命名为 phpversionOfPhp
- 启动 wamp 并单击 wamp 图标并选择您要使用的 php 版本:https: //gyazo.com/de5727d7e254795e238422783dec3758