Centos7中部署Wordpress
注:此文章仅作为笔记参考
环境:
centos7
nginx
php7.2
mariadb
wordpress
安装nginx和php-fpm
添加EPEL源然后安装nginx:
$ yum install epel-release -y
$ yum install nginx -y
安装php-fpm和wordpress的一些依赖
$ rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
$ rpm -ivh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
$ yum install epel-release yum-utils unzip curl wget bash-completion policycoreutils-python mlocate bzip2 -y
$ yum install php72w-fpm php72w-pecl-apcu-devel php72w-json php72w-pecl-apcu php72w-gd php72w-mcrypt php72w-cli \
php72w-pear php72w-xml php72w-mbstring php72w-pdo php72w php72w-cli php72w-common php72w-curl php72w-gd \
php72w-mbstring php72w-mysqlnd php72w-process php72w-xml php72w-zip \
php72w-opcache php72w-pecl-apcu php72w-intl php72w-pecl-redis php72w-pecl-imagick -y
检查一下php是否安装成功和查看版本
$ php -v
PHP 7.2.22 (cli) (built: Sep 11 2019 18:11:52) ( NTS )
Copyright © 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright © 1998-2018 Zend Technologies
配置php-fpm
编辑文件
$ vi /etc/php-fpm.d/www.conf
找到user和group这两行,修改为如下:
user = nginx
group = nginx
再找到下面这行,并确认为如下:
listen = 127.0.0.1:9000