在 Debian 中将 PHP 5.4 降级到 5.3

Car*_*ris 8 php debian php5

我不得不在我的服务器上进行 Debian dist-upgrade……在此过程中,PHP 升级到 5.4。我们使用的 ioncube 最多只支持 5.3 atm,我在寻找如何从 5.4 降级到 5.3 时遇到了一些麻烦。有谁知道怎么做?

小智 11

上述两种解决方案都不适合我。什么工作是将必要的包固定到旧的稳定器上,例如

将以下内容添加到 /etc/apt/sources.lst

deb http://ftp.us.debian.org/debian/ squeeze main contrib non-free
deb-src http://ftp.us.debian.org/debian/ squeeze main contrib non-free
Run Code Online (Sandbox Code Playgroud)

创建

/etc/apt/preferences.d/preferences

并添加您需要降级的软件包,例如在我的情况下

Package: php5*
Pin: release a=oldstable
Pin-Priority: 700

Package: libapache2-mod-php5    
Pin: release a=oldstable
Pin-Priority: 700

Package: libapache2-mod-php5
Pin: release a=oldstable
Pin-Priority: 700

Package: php-pear
Pin: release a=oldstable
Pin-Priority: 700

Package: *
Pin: release a=stable
Pin-Priority: 600
Run Code Online (Sandbox Code Playgroud)

然后运行命令

aptitude update
aptitude reinstall <necessary packages>
/etc/init.d/apache2 restart
Run Code Online (Sandbox Code Playgroud)

如果您想知道需要升级哪些软件包,只需运行:

dpkg -l|grep php|grep 5.4|awk '{print $2}'
Run Code Online (Sandbox Code Playgroud)


小智 2

您可以尝试这样做,但需要您自担风险。我自己没有尝试过。;)

  • apt-get remove php5
  • 从稳定版下载PHP5 包
  • dpkg --force php5_5.3.3-7+squeeze8_all.deb
  • dpkg --set-selections PHP5 hold

最后一行阻止升级到 5.4。当你准备好 5.4 时,运行dpkg --set-selections PHP5 install

IonCube for 5.4 与我读到的内容相差一段时间。