将 PHP 从 5.2 版本升级到 5.3
我一直使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您查看 升级到 PHP 5.3 - 一种简单的方法,我认为这会解决您的问题,但是如果您使用的是 Linux 计算机,则可以使用
apt-get
您唯一需要做的就是:问候。
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:Regards.
过渡不一定容易,但也并不困难。 PHP 5.3 对内部 Zend API 进行了一些更改,因此需要升级一些 PHP 扩展(我必须升级 xDebug)。这意味着您需要找到相应的 DLL,这可能并不那么容易,具体取决于您当前的设置。
配置文件 php.ini 几乎相同。实际上,您实际上必须删除一些东西(例如不再需要
extension=php_pdo.dll
)。只需从命令行执行 php -m 即可查看抛出的错误。我刚刚从 5.2 版本复制粘贴了 php.ini 文件,并在几分钟内完成了 5.3 的配置。
我在上面几行提到了 xDebug。如果你使用它,你应该知道激活 xDebug 的行现在是:
而不是:
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:
instead of:
我遇到的主要问题是在从 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.