Install PHP 7, NGINX & MySQL 5.6 on CentOS/RHEL 7.1 & 6.7

Install PHP 7, NGINX & MySQL 5.6 on CentOS/RHEL 7.1 & 6.7

Suitable for people who are obsessed with mysophobia and value safety. It is generally recommended to use: OneinStack: self-installation of lnmp, lamp, lnmpa, etc. (supports HHVM)
CentOS 7 is recommended. All users are root users under SSH.

1. Upgrade the system and change the update source <br />Applicable to CentOS / RHEL 7 system

 yum install epel-release rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm rpm -Uvh http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm

For CentOS / RHEL 6 systems

 yum install epel-release rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm rpm -Uvh http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm

2. Install PHP 7
1. Install PHP 7

 yum install php70w

2. Install PHP 7 components and find components

 yum search php70w

Installing Components

 yum install php70w-mysql php70w-xml php70w-soap php70w-xmlrpc yum install php70w-mbstring php70w-json php70w-gd php70w-mcrypt

3. Install NGINX
1. Install NGINX

 yum install nginx

2. Start NGINX

 systemctl enable nginx.service systemctl start nginx.service

4. Install MySQL 5.6
1. Install MySQL

 yum install mysql-server

2. Security Settings

 systemctl start mysqld.service mysql_secure_installation

3. Start MySQL

 systemctl restart mysqld.service systemctl enable mysqld.service

5. Setting up PHP-FPM

 yum install php70w-fpm

6. Create a website

 nano /etc/nginx/conf.d/example.conf

Paste the following content:

 server { listen 80; root /var/www; index index.php index.html index.htm; server_name example.com www.example.com; location / { try_files $uri $uri/ /index.html; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/www; } location ~ .php$ { try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }

Change to your own domain name and file storage directory as needed.

7. Restart the service

 systemctl restart nginx.service systemctl restart php-fpm.service

8. Open http (80) and https (443) ports on the firewall

 firewall-cmd --permanent --zone=public --add-service=http firewall-cmd --permanent --zone=public --add-service=https firewall-cmd --reload

via: https://servercheap.net/crm/index.php?rp=/knowledgebase/1/Install-PHP-7-NGINX-and-MySQL-56-on-CentOSorRHEL-71-and-67.html

<<:  HiFormance: All VPS are discounted by 25%, and the lowest annual fee for KVM VPS is only US$7.5

>>:  ImgURL: A simple, pure PHP image hosting program

Recommend

Add Virtual Host to Litespeed

Keep it for later use. Reprinted from: http://w0w...

Impact: $24/year/512MB/150GB space/600GB traffic/KVM/Seattle

Impact, introduced many times, has a stable host....

xvmlabs: $2.99/year/1CPU/512M/5G SSD/100G/4 IP/OpenVZ

xvmlabs is a newly established American hosting c...

Superb: $2/first 2 months/2GB memory/80GB hard drive/2TB data transfer/Seattle

Superb is a long-established console provider wit...

Introduction to Bluehost

1. Introduction to Bluehost Bluehost was founded ...

How to turn off MYSQL logging and disable mysql-bin.0000X files

If you enable logging in your MYSQL installation,...