apt-get -y install apt-transport-https lsb-release ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
apt-get update
apt-cache search php7.2-\* #查看支持插件
apt-get install php7.2-fpm php7.2-gd php7.2-mysql php7.2-mbstring php7.2-xml php7.2-zip php7.2-opcache
php -version #验证php版本
apt install mysql-server
默认安装版本为mariadb10.1其他版本请查阅官方配置教程
mysql_secure_installation
Enter current password for root (enter for none): #回车
Set root password? [Y/n] y #设置root密码
Remove anonymous users? [Y/n] y #删除匿名用户
Disallow root login remotely? [Y/n] y #禁用root账户远程连接
Remove test database and access to it? [Y/n] y #删除测试账户
Reload privilege tables now? [Y/n] y #重加载权限表
# 导入GPG 密钥:
wget -qO - https://openresty.org/package/pubkey.gpg | sudo apt-key add -
# 安装 add-apt-repository 命令
# (之后你可以删除这个包以及对应的关联包)
apt-get -y install software-properties-common
# 添加官方 official APT 仓库:
add-apt-repository -y "deb http://openresty.org/package/debian $(lsb_release -sc) openresty"
# 更新 APT 索引:
apt-get update
# 安装openresty:
apt-get install openresty
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。