在 Ubuntu 13.10 中将 PHP 从 5.5.3 降级到 5.4.x

Mic*_*tak 4 downgrade php ubuntu

在从 Ubuntu 13.04 升级到 13.10 的过程中,PHP 升级到了 5.5.3。

如何降级到 5.4.x?

小智 5

  1. 正如 medigeek建议的那样:您可以尝试使用ondrej php5-oldstable软件包,但我认为目前它们不适用于 Saucy Salamander。
  2. 你可以自己编译PHP。
  3. 简单的解决方案是暂时切换到旧的(稀有的)存储库,安装 PHP (5.4)、Apache (2.2) 等并锁定软件包版本(这样它就不会再升级了):

请将其视为有风险的操作,因为您可能会丢失设置并破坏系统。我没有测试所有的线路,所以请告诉我是否需要调整一些东西

# upgrade system, so you can add to ignore all updates later
sudo apt-get update
sudo apt-get upgrade

# remove your php, apache, etc
sudo apt-get purge apache2 php5 libapache2-mod-php5 # add here your server packages

# change repositories to raring  (with backup)
sudo sed -i.bak "s/saucy/raring/g" /etc/apt/sources.list

# update and install server packages
sudo apt-get update
sudo apt-get install apache2 php5 libapache2-mod-php5 phpmyadmin #add here packages you need and make sure you install php5.4 and apache2.2

# change repositories back to saucy
sudo sed -i "s/raring/saucy/g" /etc/apt/sources.list

# ignore all current upgrades (package hold)
sudo apt-mark hold `aptitude -F%p --disable-columns search ~U`
Run Code Online (Sandbox Code Playgroud)