我尝试使用下面的 PPA 存储库。
sudo add-apt-repository ppa:ondrej/php
sudo apt-get install -y php7.4 php7.4-cli php7.4-json php7.4-common php7.4-mysql php7.4-zip php7.4-gd php7.4-mbstring php7.4-curl php7.4-xml php7.4-bcmath
我收到这些错误。
E: Unable to locate package php7.4-cli
E: Couldn't find any package by glob 'php7.4-cli'
E: Couldn't find any package by regex 'php7.4-cli'
E: Unable to locate package php7.4-json
E: Couldn't find any package by glob 'php7.4-json'
E: Couldn't find any package by regex 'php7.4-json'
我可以轻松地将其安装在较新版本的 Ubuntu 上。
我尝试安装 php7.4 和 php7.4-fpm,但出现错误。我可能会修复或其他替代解决方案。
请先安装software-properties-common
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
完成上述操作后,
然后执行
sudo apt-get install -y php7.4
或者,如果你愿意的话
sudo apt-get install -y php7.4 php7.4-cli php7.4-json php7.4-common php7.4-mysql php7.4-zip php7.4-gd php7.4-mbstring php7.4-curl php7.4-xml php7.4-bcmath