我最近在笔记本电脑上安装了 20.04 LTS。我需要安装 PHP 5.6。我在 Google 上搜索了很多相关信息,但都建议安装 Via Ondrej Suri PPA。我这样做了,但出现了错误unable to locate package php5.6
。我检查了他们的存储库,发现他们支持 19.10 版本,但不支持 20.04 版本。
我是 Linux 新手。请建议其他方法。
答案1
看起来 Ondřej Surý PPA 现在已经针对 Ubuntu 20.04 LTS 进行了更新。使用以下命令从 18.04 升级到 20.04 后,php5.6 运行正常do-release-upgrade -d
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04 LTS"
$ sudo apt-get install php5.6-cli
Reading package lists... Done
Building dependency tree
Reading state information... Done
php5.6-cli is already the newest version (5.6.40-
27+ubuntu18.04.1+deb.sury.org+1).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
$ /usr/bin/php5.6 -v
PHP 5.6.40-27+ubuntu18.04.1+deb.sury.org+1 (cli)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies