Posted on

WordPress on Centos 7 + Nginx + PHP 7 + Mariadb

1.Update the epel-release and install the REPO for remi-php 7
sudo yum -y install epel-release
sudo rpm -Uvh
yum install yum-utils
yum-config-manager --enable remi-php72
2.add nginx REPO
sudo nano /etc/yum.repos.d/nginx.repo
add code in /etc/yum.repos.d/nginx.repo
name=nginx repo
3.install nginx , mariadb , php
sudo yum -y update
sudo yum -y install nginx mariadb-server git libpng12
yum -y install php-devel php-mysql php-opcache php-gd php-common php-xmlrpc php-mcrypt php-zip php-cli php-xml php-mbstring php-curl php-fpm 
4.Open firewall port for service
sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --permanent --zone=public --add-service=ftp
sudo firewall-cmd --reload
5.Setup nginx & PHP
sudo systemctl restart nginx
sudo systemctl enable nginx
sudo vi /etc/nginx/conf.d/lab.conf
sudo vi /etc/opt/remi/php71/php.ini
sudo vi /etc /php-fpm.d/www.conf
   user = nginx
   group = nginx
   listen.owner = nobody = nobody
sudo systemctl restart php-fpm
sudo systemctl enable php-fpm
6.copy the wordpress rouce code to /usr/share/nginx/wordpress/
chown -R nginx:nginx /usr/share/nginx/wordpress/
sudo systemctl restart nginx
7.setup the database
sudo systemctl restart mariadb
sudo systemctl enable mariadb 
8.Create Database for wordpress mysql –u root –p
create database wordpress;
grant all on wordpress.* to 'wordpress'@'localhost' identified by 'password';
flush privileges;