我正在使用Ubuntu22.04.1,我遇到了php版本的安装问题,特别是php7.4。

我试过这些推荐信,但对我没有用。
https://www.linuxcapable.com/how-to-install-php-7-4-on-ubuntu-20-04-lts/
How can I install php7.4 on Ubuntu 19.04?
https://www.codegrepper.com/code-examples/php/%3A+Unable+to+locate+package+php7.4-fpm
救命啊!谢谢。
发布于 2022-11-29 12:31:41
在Linux操作系统中按以下命令在任意版本(用所需版本替换php7.4 )上安装php:
sudo apt-get update
sudo apt -y install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt -y install php7.4查看PHP版本:
php -v您可能需要一些其他软件包来安装。您可以通过以下命令来做到这一点:
sudo apt-get install -y 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
sudo apt install php7.4-fpm启动FPM并检查状态:
systemctl restart php7.4-fpm
systemctl status php7.4-fpm上述行动解决了这个问题.
https://stackoverflow.com/questions/73786272
复制相似问题