将 PHP 从 5.2 版本升级到 5.3

发布于 2024-08-08 19:54:20 字数 173 浏览 4 评论 0原文

我一直使用 PHP 版本 5.2,现在需要升级到版本 5.3 (Windows/Apache)。我已经使用 5.2 一段时间了,在 php.ini 中定制了很多东西,并添加了一些额外的扩展。

如何升级到版本 5.3 而无需重新配置所有内容?或者升级是否需要我重新定制我的 PHP 安装?

谢谢,布莱恩

I've been using PHP version 5.2 and now need to upgrade to version 5.3 (Windows/Apache). I have been using 5.2 for awhile now and have customized many things in php.ini and added some extra extensions.

How can I upgrade to version 5.3 without having to reconfigure everything? Or does upgrading require that I customize my PHP installation all over again?

Thanks, Brian

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

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

发布评论

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

评论(3

浮光之海 2024-08-15 19:54:20

如果您查看 升级到 PHP 5.3 - 一种简单的方法,我认为这会解决您的问题,但是如果您使用的是 Linux 计算机,则可以使用 apt-get您唯一需要做的就是:

$ sudo apt-get upgrade php php-* mysql-*
$ /etc/init.d/httpd restart

问候。

If you take a look at Upgrading to PHP 5.3 - an easy way, i think that will solve your problem, but if you're in a Linux machine that you can use apt-get the only thing that you need to do is:

$ sudo apt-get upgrade php php-* mysql-*
$ /etc/init.d/httpd restart

Regards.

诗化ㄋ丶相逢 2024-08-15 19:54:20

过渡不一定容易,但也并不困难。 PHP 5.3 对内部 Zend API 进行了一些更改,因此需要升级一些 PHP 扩展(我必须升级 xDebug)。这意味着您需要找到相应的 DLL,这可能并不那么容易,具体取决于您当前的设置。

配置文件 php.ini 几乎相同。实际上,您实际上必须删除一些东西(例如不再需要extension=php_pdo.dll)。

只需从命令行执行 php -m 即可查看抛出的错误。我刚刚从 5.2 版本复制粘贴了 php.ini 文件,并在几分钟内完成了 5.3 的配置。

我在上面几行提到了 xDebug。如果你使用它,你应该知道激活 xDebug 的行现在是:

zend_extension = "path\to\PHP 5.3.0\ext\php_xdebug.dll"

而不是:

zend_extension_ts = "path\to\PHP 5.3.0\ext\php_xdebug.dll"

The transition is not necessarily easy, but not hard also. PHP 5.3 brings some changes to the internal Zend API, so some PHP extension need to be upgraded (I had to upgrade xDebug). That means that you need to find the respective DLLs, which may not be that easy, depending on your current setup.

The config file, php.ini, is pretty much the same. You will actually have to take some things out actually (for example extension=php_pdo.dll is not needed anymore).

Just execute php -m from command line and see what errors are thrown. I have just copy-pasted the php.ini file from a 5.2 release and was done configuring 5.3 in a couple of minutes.

I mentioned xDebug a few lines above. If you use it, you should know that the line which activates xDebug is now:

zend_extension = "path\to\PHP 5.3.0\ext\php_xdebug.dll"

instead of:

zend_extension_ts = "path\to\PHP 5.3.0\ext\php_xdebug.dll"
梦言归人 2024-08-15 19:54:20

我遇到的主要问题是在从 PEAR 执行任何操作时出现一堆新的 E_DEPRECATED 通知。与其他评论一样,您需要适当调整错误报告级别。

另一件需要注意的事情是,如果您从 macports 或 apt 等包管理系统升级,一些配置布局已经改变,您必须适应那里。

除此之外,5.2 和 5.3 之间没有太多功能差异。

The main thing I've run into is a mess of new E_DEPRECATED notices when doing anything from PEAR. Like the other comments, you'll want to adjust your error reporting levels appropriately.

Another thing to notice is that if you're upgrading from a package management system like macports or apt, some of the config layouts have changed and you'll have to adapt there.

Other than that, there aren't a lot of functional differences between 5.2 and 5.3.

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