网站首页 文章专栏 centos 7 安装 nginx,mysql,php

centos 7 安装 nginx,mysql,php

编辑时间:2018-09-14 22:25:30 作者:苹果 浏览量:1063




yum安装 nginx源:

rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm Retrieving http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

或者 yum install epel-release

切记关闭 防火墙  systemctl stop firewalld  setenforce 0



yum安装mysql源:

wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm

然后进行repo的安装:

rpm -ivh mysql57-community-release-el7-9.noarch.rpm

执行完成后会在/etc/yum.repos.d/目录下生成两个repo文件mysql-community.repo mysql-community-source.repo

使用yum命令即可完成安装

yum install mysql-server

安装 完后 systemctl start mysqld

grep 'temporary password' /var/log/mysqld.log 获取 root初始密码


set password for 'root'@'localhost'=password('112aa!@afqlgjkq'); (密码设置复杂点,建议用个小本本 记下)



yum 安装php源:

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm


rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm



yum -y install php72w php72w-cli php72w-common php72w-devel php72w-embedded php72w-fpm php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml

配置php处理器

vim /etc/php.ini

查找cgi.fix_pathinfo
将 ;cgi.fix_pathinfo=1改为cgi.fix_pathinfo=0

配置www.conf

vim /etc/php-fpm.d/www.conf


user = nobody
group = nobody
改为
user = nginx
group = nginx

systemctl start  php-fpm




    出自:何冰华个人网站

    地址:http://www.hebinghua.com/

    转载请注明出处


来说两句吧
最新评论