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

IntegralHost: $8/year/128MB RAM/5GB storage/100GB bandwidth/OpenVZ/USA

IntegralHost, a foreign hosting provider, was est...

Dynadot.com Hosting Introduction

Dynadot.com provides web hosting and domain regis...

Hosteons: $3/month/1GB RAM/5GB SSD space/unlimited data/100Mbps/KVM/Los Angeles

Hosteons, a Singapore hosting provider, provides ...

Internoc24: €9.95/month/4GB RAM/100GB HDD/1TB bandwidth/OpenVZ/Los Angeles

Internoc24, a long-established hosting provider. ...

Register.com domain name discount $0.50/year

Received an email with a big discount on Register...

Repko Networks: 4.99 EUR/month/1 core/1GB memory/80GB/unlimited/1 IP/KVM

Repko Networks, an American hosting company, was ...