PHP 版本升级 5.3.25 到 5.6
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29272612/
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
PHP version upgrade 5.3.25 to 5.6
提问by uday8486
We have a requirement for upgrading the PHP version (5.3.25) to current stable version which is 5.6.17. So, for this we need to find which approach would be best.
我们需要将 PHP 版本 (5.3.25) 升级到当前的稳定版本 5.6.17。因此,为此我们需要找到哪种方法最好。
- Step by step approach, in which we can upgrade from 5.3.X to 5.4.X, 5.4.X to 5.5.X and so on.
- Direct upgrade, in this we will directly upgrade from 5.3.X to 5.6.X.
- 循序渐进,其中我们可以从5.3.X升级到5.4.X,5.4.X升级到5.5.X等等。
- 直接升级,这里我们直接从5.3.X升级到5.6.X。
Apart from the upgrade, what all things we should keep in mind while doing this.
除了升级之外,我们在做这件事时应该记住的所有事情。
It would be good, if any of you have any documents which we can refer to.
如果你们中的任何人有任何我们可以参考的文件,那就太好了。
回答by Etki
PHP maintainers upload list of incompatible changes of every release. Here are the documents you may want to read:
PHP 维护者上传每个版本的不兼容更改列表。以下是您可能想要阅读的文件:
If you have regression tests, you're the lucky man; if you don't, i strongly recommend test every change in virtual environment before real environment update on main server. If you're brave enough, you can try to setup vagrant - this will allow developers to easily share their environment and to reproduce server state as it should be after upgrade to 5.6.
如果你有回归测试,你就是幸运的人;如果你不这样做,我强烈建议在主服务器上的真实环境更新之前测试虚拟环境中的每一个变化。如果您足够勇敢,可以尝试设置 vagrant - 这将允许开发人员轻松共享他们的环境并重现升级到 5.6 后应有的服务器状态。
I also wouldn't recommend partial upgrades, i think it's better to target for 5.6 at the first (and only) migration step.
我也不推荐部分升级,我认为最好在第一个(也是唯一的)迁移步骤中针对 5.6。
回答by Cedric
On my experience, we upgraded our PHP version from 5.3.28 to 5.6.6 directly because of server upgrades, and one more reason is you can easily check all your modules faster if there's an error rather than checking it on every version.
根据我的经验,由于服务器升级,我们直接将 PHP 版本从 5.3.28 升级到 5.6.6,还有一个原因是如果出现错误,您可以轻松更快地检查所有模块,而不是在每个版本上都检查它。
What you should keep in mind:
你应该记住的:
- deprecated functions
- if you're using PHP frameworks (CodeIgniter, Laravel, etc.), consider upgrading them too
- current code implementations
- 弃用的功能
- 如果您正在使用 PHP 框架(CodeIgniter、Laravel 等),请考虑升级它们
- 当前代码实现