将 Web 服务器从 PHP 4 升级到 PHP 5。现有网站有什么风险吗?

发布于 2024-11-27 13:59:22 字数 433 浏览 0 评论 0原文

我正在为一家公司做一个项目,在使用 CakePHP 1.3 时遇到了一个小问题。我发现问题是他们目前拥有的 1&1 主机使用的是 PHP 4,而我的问题可以使用 PHP 5 轻松解决。

在主机的控制面板中,有一个选项可以更改全局 PHP版本从 4 到 5。但是,在我开发这个项目的同一台服务器中,该公司已经有一堆网站正在运行(比如 8 个左右),所有这些网站都使用了大量的 PHP 和MySQL 代码...

是否存在真正的风险只是切换 PHP 版本?因为我当然不想升级,突然所有其他网站都停止工作。

我不知道是否有一种“简单”的方法来检查服务器文件中的代码。进行切换然后再次尝试所有内容几乎是不可能的,需要尝试的内容太多......

我应该只处理 PHP 4 吗?无论如何,他们都必须升级吗?对于这个问题任何建议都会很好,谢谢!

I'm doing a project for a comapny and I ran into a small problem using CakePHP 1.3. I found out that the problem was that the 1&1 hosting they currently have is using PHP 4, and my problem could be easily solved using PHP 5.

In the Control Panel of the hosting there's an option to change the Global PHP version from 4 to 5. However, in the same server where I'm developing this project, this company has a bunch of websites already running (like 8 or so), all of them with a high amount of PHP and MySQL code...

Is there any real risk to just switch the PHP version? Because of course I don't want to upgrade and suddently all the other websites stop working.

I don't know if there's an "easy" way to check the code in the server files. Making the switch and then trying everything again would be almost impossible, too much content to try...

Should I just deal with PHP 4? Are they going to have to upgrade no matter what? Any advice for this issue would be great, thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

骷髅 2024-12-04 13:59:22

简单地放入 PHP5 肯定存在破坏某些东西的风险。请参阅PHP 4 到 PHP 5 迁移索引,最值得注意的是“向后不兼容更改”部分。考虑到 PHP5 是在 2004 年问世的? -- 我认为让客户期望您将环境保持最新是完全合理的,而坚持使用 PHP4 会阻止您这样做。此外,当您继续使用保持最新的第三方库开发网站时,不采用 PHP5 只会导致更多此类问题。也就是说,如果他们期待更多的工作,这种情况就会越来越频繁地发生。

编辑:或者,如果您根本无法将它们切换到 5 个,您也许可以让他们启动另一个托管帐户并将该帐户设置为 5 — 然后使用它一次迁移一个以上的站点。

There is definitely a risk of breaking something by simply dropping in PHP5. See the PHP 4 to PHP 5 migration index, most notably, the Backward Incompatible Changes section. Considering that PHP5 came out in, what... 2004? -- I think it's perfectly reasonable to have clients expect that you're going to keep your environment up to date and that clinging to PHP4 prevents you from doing so. In addition, not embracing PHP5 is going to just cause more problems like this as you continue to develop sites with 3rd party libraries that are being kept up-to-date. I.e., if they're expecting more work, this will just continue to happen more and more often.

Edit: Alternatively, if you simply can't switch them to 5, you might be able to get them to start another hosting account and set that one to 5 -- then use that to migrate the sites over one at a time.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文