Ubuntu apt 安装 php7.4
环境: Ubuntu 22.04 LTS
1. 安装
更新软件源:
sudo apt update
软件提供了 apt 存储库的抽象, 它允许你轻松管理你的发行版和独立软件供应商的软件源:
sudo apt install software-properties-common
添加 PHP 版本源
sudo add-apt-repository ppa:ondrej/php
安装 PHP 环境及依赖
sudo apt install php7.4-cli php7.4-fpm php7.4-mysql php7.4-xml php7.4-curl php7.4-gd php7.4-json php7.4-mbstring php7.4-intl php7.4-bcmath php7.4-bz2 php7.4-zip php7.4-zip php7.4-json php7.4-redis