在 Ubuntu 下更新 LNMP 组件(Linux, Nginx, MySQL/MariaDB, PHP)的方法如下:
sudo apt-get update
sudo apt-get upgrade
如果你想单独更新 Nginx、MySQL/MariaDB 或 PHP,可以使用以下命令:
sudo apt-get install nginx
sudo apt-get install mysql-server
sudo apt-get install mariadb-server
sudo apt-get install php7.4-fpm php7.4-mysql php7.4-xml php7.4-mbstring php7.4-curl php7.4-gd
请根据你的需求选择相应的 PHP 版本和扩展。
在更新完成后,重启相应的服务以使更改生效:
sudo systemctl restart nginx
sudo systemctl restart mysql
sudo systemctl restart mariadb
sudo systemctl restart php7.4-fpm
检查服务状态以确保它们已成功启动:
sudo systemctl status nginx
sudo systemctl status mysql
sudo systemctl status mariadb
sudo systemctl status php7.4-fpm
现在,你已经成功更新了 Ubuntu 下的 LNMP 组件。请注意,根据你的实际需求,你可能需要安装其他 PHP 扩展或调整配置文件。