使 PHP7.2 在 Ubuntu 19.10 下运行

使 PHP7.2 在 Ubuntu 19.10 下运行

我安装了 Ubuntu 19.10 并将其用于 Web 开发,主要使用 PHP 框架。

我们有几个项目运行 php7.2 和 php7.3。我安装了 7.3,但是 7.2 不存在?

我已经添加了 PPA ppa:ondrej/php,获得了 php7.3,但是安装 php7.2 时出现错误

$ sudo apt update

Hit:1 http://linux.teamviewer.com/deb stable InRelease
Hit:2 https://dl.yarnpkg.com/debian stable InRelease                                                                                                                                                                      
Hit:3 http://ca.archive.ubuntu.com/ubuntu eoan InRelease                                                                                                                                                                  
Ign:4 http://dl.google.com/linux/chrome/deb stable InRelease                                                                                                                      
Hit:5 http://dl.google.com/linux/chrome/deb stable Release                                                                                                                        
Hit:6 http://security.ubuntu.com/ubuntu eoan-security InRelease                                    
Hit:7 http://ca.archive.ubuntu.com/ubuntu eoan-updates InRelease    
Hit:8 http://ppa.launchpad.net/cappelikan/ppa/ubuntu eoan InRelease          
Hit:9 http://ca.archive.ubuntu.com/ubuntu eoan-backports InRelease                                      
Get:11 http://ppa.launchpad.net/ondrej/php/ubuntu eoan InRelease [20.8 kB]                              
Hit:12 http://ppa.launchpad.net/teejee2008/ppa/ubuntu eoan InRelease
Fetched 20.8 kB in 3s (8,105 B/s)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
$ sudo apt install -y php7.2 php7.2-cli

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'php7.2-sodium' for regex 'php7.2'
Note, selecting 'php7.2-thrift' for regex 'php7.2'
E: Unable to locate package php7.2-cli
E: Couldn't find any package by glob 'php7.2-cli'
E: Couldn't find any package by regex 'php7.2-cli'

有人能够在 Ubuntu 19.10 上安装 7.2 吗,还是我运气不好?

答案1

将其添加到您的/etc/sources.list文件中:

deb http://archive.ubuntu.com/ubuntu/ disco main

答案2

这是 19.10 的一个已知错误,现已修复。https://github.com/oerdnj/deb.sury.org/issues/1262

相关内容