Install Nginx, PHP 7.x | PHP 5.6, MySQL (Percona) 5.7 on CentOS 7.x

Step 1 – Setup Yum Repository

# yum update -y
# yum install epel-release
# yum install -y htop mc ntp net-snmp net-snmp-utils traceroute wget unzip tcpdump screen cowsay telnet psmisc lynx jq net-tools glances

Step 2 – Install PHP 7.x & PHP 5.6

PHP 7.x

# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
# yum --enablerepo=remi-php72 install php
# yum --enablerepo=remi-php72 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt php-cgi
# yum --enablerepo=remi-php72 install php php-bcmath php-cli php-common php-dba php-devel php-embedded php-enchant php-fpm php-gd php-imap php-interbase php-intl php-ldap php-mbstring php-mcrypt php-mysql php-mysqlnd php-odbc php-opcache php-pdo php-pdo_dblib php-pear php-pecl-apcu php-pecl-imagick php-pecl-memcached php-pecl-mongodb php-pecl-redis php-pecl-xdebug php-pgsql php-phpdbg php-process php-pspell php-recode php-snmp php-soap php-tidy php-xml php-xmlrpc php-zip

PHP 5.6

# yum install php56 php56-php-xml php56-php-soap php56-php-xmlrpc php56-php-mbstring php56-php-json php56-php-gd php56-php-mcrypt php56-php-cgi php56-php-bcmath php56-php-cli php56-php-common php56-php-dba php56-php-devel php56-php-embedded php56-php-enchant php56-php-fpm php56-php-gd php56-php-imap php56-php-interbase php56-php-intl php56-php-ldap php56-php-mbstring php56-php-mcrypt php56-php-mysql php56-php-mysqlnd php56-php-odbc php56-php-opcache php56-php-pdo php56-php-pdo_dblib php56-php-pear php56-php-pecl-apcu php56-php-pecl-imagick php56-php-pecl-memcached php56-php-pecl-mongodb php56-php-pecl-redis php56-php-pecl-xdebug php56-php-pgsql php56-php-phpdbg php56-php-process php56-php-pspell php56-php-recode php56-php-snmp php56-php-soap php56-php-tidy php56-php-xml php56-php-xmlrpc php56-php-zip

PhpMyAdmin

# yum install -y phpmyadmin

Install ioncube

# wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
# tar xzvf ioncube_loaders_lin_x86-64.tar.gz
# cp ioncube/ioncube_loader_lin_7.2.so /usr/lib64/php/modules/
# cp ioncube/ioncube_loader_lin_5.6.so /usr/lib64/php/modules/

# vi /etc/php.ini
;;;;
zend_extension = /usr/lib64/php/modules/ioncube_loader_lin_7.2.so
date.timezone = Asia/Jakarta
memory_limit = 512M
max_execution_time=300;
max_input_time=-1
upload_max_filesize=256M;
max_file_uploads = 128
post_max_size=256M;
max_input_vars = 9999999

Restart PHP service

php 7.x
# systemctl enable php-fpm
# systemctl restart php-fpm

php 5.6
# systemctl enable php56-php-fpm
# systemctl restart php56-php-fpm

Step 3 – Install NGINX

# yum install -y nginx

Restart NGINX service

# systemctl enable nginx
# systemctl restart nginx

Step 4 – Install MySQL 5.7 (Percona Server)

# yum install https://repo.percona.com/yum/percona-release-latest.noarch.rpm
# yum install Percona-Server-server-57

Get temporary password mysql

# systemctl start mysql
# grep 'temporary password' /var/log/mysqld.log
# mysql_secure_installation

Restart MySQL Service

# systemctl enable mysql
# systemctl restart mysql