在命令下运行时出现此错误

sudo apt install php7.2 php7.2-common php7.2-cli php7.2-fpm

正在读取状态信息...完成
E: Unable to locate package php7.2
E: Couldn't find any package by glob 'php7.2'
E: Couldn't find any package by regex 'php7.2'
E: Unable to locate package php7.2-common
E: Couldn't find any package by glob 'php7.2-common'
E: Couldn't find any package by regex 'php7.2-common'
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'
E: Unable to locate package php7.2-fpm
E: Couldn't find any package by glob 'php7.2-fpm'
E: Couldn't find any package by regex 'php7.2-fpm'

最佳答案

您需要手动添加ondrej PPA才能在Ubuntu 17上安装PHP7.2

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.2

或者通过克隆git存储库从源代码进行编译, checkout 所需的版本,进行安装

有关从源代码编译PHP的更多信息,请从源代码中查看how to build/compile PHP

09-11 19:44
查看更多