centos7.9minimal,一键安装nginx+mariadb+php7.4

本文详细描述了在CentOS7系统中安装Nginx、MariaDB数据库以及PHP7.4的过程,包括配置yum软件源、安装相关组件、启动服务等步骤。
摘要由CSDN通过智能技术生成

进入centos7以后,

cd ~
vi nmp.sh

粘贴以下内容:


#!/bin/bash

#nginx最新版
#vi /etc/yum.repos.d/nginx.repo
#nginx.repo的内容
cat > /etc/yum.repos.d/nginx.repo << EOL
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/\$basearch
gpgcheck=0
enabled=1
EOL

#vi /etc/yum.repos.d/MariaDB.repo
#MariaDB.repo的内容
cat > /etc/yum.repos.d/MariaDB.repo << EOL
# MariaDB 10.6 CentOS repository list - created 2021-09-21 08:57 UTC
# https://mariadb.org/download/
[mariadb]
name = MariaDB
baseurl = http://mirrors.accretive-networks.net/mariadb/yum/10.6/centos7-amd64
gpgkey=http://mirrors.accretive-networks.net/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOL

yum clean all
yum makecache

yum install -y lrzsz unzip zip ifstat iftop vim p7zip wget nettools
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm --no-check-certificate
wget https://rpms.remirepo.net/enterprise/remi-release-7.rpm --no-check-certificate
rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm

yum install -y nginx MariaDB-server MariaDB-client
systemctl start nginx
systemctl enable nginx
systemctl start mariadb
systemctl enable mariadb

yum install -y php74-php-devel php74-php-fpm php74-php-mbstring php74-php-memcache php74-php-redis php74-php-mysqli php74-php-mysqlnd php74-php-pdo php74-php-bcmath php74-php-dom php74-php-gd php74-php-gmp php74-php-igbinary php74-php-imagick php74-php-mcrypt php74-php-pdo_mysql php74-php-pdo_sqlite php74-php-posix php74-php-simplexml php74-php-opcache php74-php-xsl php74-php-xmlwriter php74-php-xmlreader php74-php-xml php74-php-process

ln -s /opt/remi/php74/root/usr/bin/php /usr/local/bin/php
systemctl enable php74-php-fpm
systemctl start php74-php-fpm

然后:wq!保存并退出

chmod 777 nmp.sh
./nmp.sh

收工

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值