进入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
收工