开发者社区> 问答> 正文

ubuntu5.3降级安装5.2


因为要用到Zend Optimizer,但Zend Optimizer v3.3.9并不支持php5.3,特别是在国内一些程序开发商,一直使用旧的平台,新的zend guard与Zend Optimizer并不兼容,所以近切的需要将php5.3降级为5.2
因为这个问题,我折腾了整整一天,按照网上的教程,使用karmic源(UBUNTU 9.10),一直没有成功。一直安装的都是PHP5.3.3
后终于找到原因:ubuntu 9.10的支持日期已经过了,网络上面的karmic源全是错误的,正常的源karmic.list应该是:

[align=start]

  1. # deb cdrom:[Ubuntu 10.04 LTS _Lucid Lynx_ - Release amd64 (20100429)]/ karmic main restricted
  2. # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
  3. # newer versions of the distribution.
  4. deb http://old-releases.ubuntu.com/ubuntu/ karmic main restricted
  5. deb-src http://old-releases.ubuntu.com/ubuntu/ karmic main restricted
  6. ## Major bug fix updates produced after the final release of the
  7. ## distribution.
  8. deb http://old-releases.ubuntu.com/ubuntu/ karmic-updates main restricted
  9. deb-src http://old-releases.ubuntu.com/ubuntu/ karmic-updates main restricted
  10. ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
  11. ## team. Also, please note that software in universe WILL NOT receive any
  12. ## review or updates from the Ubuntu security team.
  13. deb http://old-releases.ubuntu.com/ubuntu/ karmic universe
  14. deb-src http://old-releases.ubuntu.com/ubuntu/ karmic universe
  15. deb http://old-releases.ubuntu.com/ubuntu/ karmic-updates universe
  16. deb-src http://old-releases.ubuntu.com/ubuntu/ karmic-updates universe
  17. ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
  18. ## team, and may not be under a free licence. Please satisfy yourself as to
  19. ## your rights to use the software. Also, please note that software in
  20. ## multiverse WILL NOT receive any review or updates from the Ubuntu
  21. ## security team.
  22. deb http://old-releases.ubuntu.com/ubuntu/ karmic multiverse
  23. deb-src http://old-releases.ubuntu.com/ubuntu/ karmic multiverse
  24. deb http://old-releases.ubuntu.com/ubuntu/ karmic-updates multiverse
  25. deb-src http://old-releases.ubuntu.com/ubuntu/ karmic-updates multiverse
  26. ## Uncomment the following two lines to add software from the 'backports'
  27. ## repository.
  28. ## N.B. software from this repository may not have been tested as
  29. ## extensively as that contained in the main release, although it includes
  30. ## newer versions of some applications which may provide useful features.
  31. ## Also, please note that software in backports WILL NOT receive any review
  32. ## or updates from the Ubuntu security team.
  33. # deb http://old-releases.ubuntu.com/ubuntu/ karmic-backports main restricted universe multiverse
  34. # deb-src http://old-releases.ubuntu.com/ubuntu/ karmic-backports main restricted universe multiverse
  35. ## Uncomment the following two lines to add software from Canonical's
  36. ## 'partner' repository.
  37. ## This software is not part of Ubuntu, but is offered by Canonical and the
  38. ## respective vendors as a service to Ubuntu users.
  39. # deb http://archive.canonical.com/ubuntu karmic partner
  40. # deb-src http://archive.canonical.com/ubuntu karmic partner
  41. deb http://old-releases.ubuntu.com/ubuntu karmic-security main restricted
  42. deb-src http://old-releases.ubuntu.com/ubuntu karmic-security main restricted
  43. deb http://old-releases.ubuntu.com/ubuntu karmic-security universe
  44. deb-src http://old-releases.ubuntu.com/ubuntu karmic-security universe
  45. deb http://old-releases.ubuntu.com/ubuntu karmic-security multiverse
  46. deb-src http://old-releases.ubuntu.com/ubuntu karmic-security multiverse





操作过程如下:


1、下载附件
http://www.zhcn.org/563/
karmic.list  放在/etc/apt/sources.list.d目录中
php   放在/etc/apt/preferences.d目录中
2、运行命令[align=start]
  1. sudo apt-get update
  2. sudo apt-get remove php5 libapache2-mod-php5 php5-xsl php5-gd php-pear php5-mysql php5-curl php5-memcache
  3. sudo apt-get install php5 libapache2-mod-php5 php5-xsl php5-gd php-pear php5-mysql php5-curl php5-memcache



我在php文件中还加入了 libapache2-mod-php5,php5-mcrypt,php5-dev,php5-xcache
例如需要安装xcache,直接运行:
sudo apt-get install php5-xcache



如果需要能过APT-GET安装其它的组件,需要更改上面的php文件,在最后面加入组件的名字即可,非常方便

展开
收起
mailshuxin 2012-09-16 11:28:39 12126 0
3 条回答
写回答
取消 提交回答
  • 顺便想知道一下,有centOS 6.2下怎么装php5.2.17
    2012-09-16 14:40:41
    赞同 展开评论 打赏
  • 回1楼tftaxis的帖子
    是PHP5.3
    2012-09-16 12:42:32
    赞同 展开评论 打赏
  • ????ubuntu5.3??????
    2012-09-16 12:11:51
    赞同 展开评论 打赏
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载