欢迎来到站长教程网!

PHP教程

当前位置: 主页 > 网络编程 > PHP教程

安装LNMP环境

更新时间:2025-05-12 07:11:24|栏目:PHP教程|点击:10 次

换源

# 换清华大学镜像源

 

echo "# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmwaredeb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmwaredeb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmwaredeb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware" | tee /etc/apt/sources.list

 

# 更新
apt update -y && apt upgrade -y

需求:php7.4及以上,Mysql5.7及以上,nginx

以下均安装截至2023年11月14日最新稳定版本

nginx1.24.0

mysql8.0

php8.2.12

 

1、安装Nginx

一般安装
apt install nginx -y安装最新版
安装依赖包
apt install curl gnupg2 ca-certificates lsb-release debian-archive-keyring -y

 

添加密钥
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \
| sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null

 

添加nginx的存储库
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
http://nginx.org/packages/debian $(lsb_release -cs) nginx" \
| sudo tee /etc/apt/sources.list.d/nginx.list

 

设置存储库优先选择自定义的仓库的包而不是发行版提供的包
echo -e "Package: *\nPin: origin nginx.org\nPin: release o=nginx\nPin-Priority: 900\n" \
| sudo tee /etc/apt/preferences.d/99nginx

 

安装
apt update
apt install nginx -y

 

查看版本
nginx -v

 

https://blog.csdn.net/sober_pindi/article/details/147564276

上一篇:PHP中实现一个简易三角形的方法

栏    目:PHP教程

下一篇:PHP 7安装使用体验之性能大提升,兼容性强,扩展支

本文标题:PHP中实现九九乘法口诀表

本文地址:http://tp2.com/index.php?m=home&c=View&a=index&aid=172

广告投放 | 联系我们 | 版权申明

重要申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:88888888 | 邮箱:888petersds@gmail.com

Copyright © 2002-202X 某某站长教程网 版权所有 非商用版本粤ICP备xxxxxxxx号