如何在Ubuntu 12.04中将PHP版本从5.3降级到5.2? [英] How to downgrade PHP version from 5.3 to 5.2 in Ubuntu 12.04?

查看:178
本文介绍了如何在Ubuntu 12.04中将PHP版本从5.3降级到5.2?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了Ubuntu 12.04,也安装了PHP.默认情况下,它安装在5.3.10版本中,但是我的PHP项目不支持PHP v5.3.10.

I have freshly installed Ubuntu 12.04 and I have installed PHP as well. By default, it is installed with version 5.3.10 but my PHP project doesn't support PHP v5.3.10.

我想将PHP版本降级到5.2.我该怎么办?

I want to downgrade PHP version to 5.2. How can I do it?

推荐答案

您将必须卸载PHP,然后重新安装旧版本.但是,如果您从事的项目是要出售或提供给客户的产品,或者无论如何,我的建议是删除实际上在5.2x和5.3x之间中断的任何功能,并用新的对应部件代替,大多数情况下人们不会希望出于任何需要而恢复到旧版本的PHP,通常来说,PHP版本只会朝着一个方向发展,如果您将自己限制在5.2之内,而制作软件却以某种形式出现在人们面前,那您将要做什么?明年所有服务器都配备PHP 6时?更不用说许多托管解决方案,它们试图在其中提供最新和最好的新计算机,并且不会为单个客户端还原,尤其是在共享托管环境中.

You would have to uninstall PHP and then reinstall an older version. However if your working on a project that your going to sell, or give to clients, or whatever the case my suggestion would be take out any functionality thats actually breaking between 5.2x and 5.3x and replace it with its new counter parts, as most people will not want to revert to older versions of PHP for any needs, and generally speaking php versions only goin in one direction, if you block yourself into 5.2 and your making software in one shape or another for people, what are you going to do next year when all the servers come stock with PHP 6? Not to mention a lot of hosted solutions try to provide the latest and greatest on there new machines, and will not revert for a single client especially on a shared hosting environment.

无论如何,在Ubuntu下的终端中再次返回您的问题,您可以尝试以下操作. sudo apt-get purge php5它将提示您输入密码,然后假设您拥有独立的PHP软件包且未与某些预配置的LAMP堆栈捆绑在一起,然后继续删除PHP,但是从总体上讲,只要版本正确,它仍然应该可以正常工作

Anyway yea, back to your question again in your terminal under Ubuntu, you can try the following. sudo apt-get purge php5 which will then prompt you for a password, then proceed with removing PHP assuming you have the PHP package standalone and not bundled in with some preconfigured LAMP stack, but then again it should still work generally speaking so long as the version is right.

关于重新安装,请从命令中删除purge并使用install.但是,您将需要查找安装PHP存档版本的方法,因为apt-get将为您提供最新的

As for reinstalling it, remove purge from the command and use install. However you will need to look up the means of getting an archived version installed of PHP as apt-get will get you the latest

这篇关于如何在Ubuntu 12.04中将PHP版本从5.3降级到5.2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆