将 PHP 从 5.2 版本升级到 5.3

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1609325/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 03:15:45  来源:igfitidea点击:

Upgrade PHP from version 5.2 to 5.3

phpwindowsupgrade

提问by Brian

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.

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

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?

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

Thanks, Brian

谢谢,布赖恩

采纳答案by Ionu? G. Stan

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.

过渡不一定容易,但也不难。PHP 5.3 给内部 Zend API 带来了一些变化,所以一些 PHP 扩展需要升级(我不得不升级 xDebug)。这意味着您需要找到相应的 DLL,这可能并不容易,具体取决于您当前的设置。

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.dllis not needed anymore).

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

Just execute php -mfrom 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.

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

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

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

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"

回答by Nathan Campos

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-getthe only thing that you need to do is:

如果您查看升级到 PHP 5.3 - 一种简单的方法,我认为这将解决您的问题,但如果您使用的是 Linux 机器,您可以使用apt-get的唯一方法是:

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

Regards.

问候。

回答by Justin

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.

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

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.

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

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

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