lnmp-7/8-安装


# centos 7 
yum install net-tools  pcre pcre-devel lib library epel-release -y
# 安装php 库包
yum install dnf-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm
yum module reset php  #重置php模块
yum module enable php:remi-7.4  #默认设置为remi-7.3版本 
#yum module enable php:remi-8.0  #默认设置为remi-8.0版本
yum -y install php php-mysqlnd php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-zip



wget https://repo.mysql.com//mysql80-community-release-el7-3.noarch.rpm
dnf install net-tools  pcre pcre-devel lib library -y

# centos 8   安装epel8
yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
sed -i 's|^#baseurl=https://download.fedoraproject.org/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*
sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*
# 安装php 库包
dnf install dnf-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm
dnf module reset php  #重置php模块
dnf module enable php:remi-7.3  #默认设置为remi-7.3版本 
#dnf module enable php:remi-8.0  #默认设置为remi-8.0版本
dnf -y install php php-mysqlnd php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-zip php-fpm
systemctl enable php-fpm && systemctl start php-fpm
#安装nginx
dnf install nginx -y
sed -r '48s/}/index index.php index.html index.htm;\\n\\t}/' /etc/nginx/nginx.conf
sed -r '57s/}/}\n\tlocation ~ \.php$ {\n\troot           html;\n\tfastcgi_pass   127.0.0.1:9000;\n\tfastcgi_index  index.php;\n\tfastcgi_param  SCRIPT_FILENAME  \/usr\/local\/nginx\/html\$fastcgi_script_name;\n\tinclude        fastcgi_params;\n\t}/' /etc/nginx/nginx.conf
systemctl enable nginx  & nginx
# 安装 mysql
wget https://repo.mysql.com//mysql80-community-release-el8-1.noarch.rpm
dnf install mysql-server -y
systemctl enable mysqld & systemctl start mysqld
mysqladmin -uroot -p' ' password Woshinendie.





./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/ --tmpdir=/usr/local/mysql/tmp


Author: 千里
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint policy. If reproduced, please indicate source 千里 !
  TOC