KrnlPanic's Linux Notes and Tips

Working with linux since kernel version 2.0.30

Apache / MySQL 8.0 / PHP 7.2 install on CentOS 7

The following steps are used to install Apache, MySQL and PHP on a new CentOS 7 droplet created at Digital Ocean. If you haven’t checked out Digital Ocean yet – you definitely should!

All of the steps below are to be executed from a root command-line. Good luck!

Install system updates and wget

# yum update -y
# yum install wget -y

Install MySQL 8

# wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
# rpm -ivh mysql80-community-release-el7-3.noarch.rpm
# yum install mysql-server -y
# systemctl start mysqld
# systemctl enable mysqld.service
# grep ‘temporary password’ /var/log/mysqld.log
# mysql_secure_installation

Install Apache

# yum install httpd -y
# systemctl enable httpd.service

Install PHP 7.2

# yum install epel-release –y
# yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
# yum-config-manager –disable remi-php54
# yum-config-manager ––enable remi–php72 ## This might not work – see next step
# vi /etc/yum.repos.d/remi-php72.repo ## set enabled = 1
# yum install php php-common php-opcache php-mcrypt php-cli php-gd php-curl php-mysql –y
# echo “<?php phpinfo(); ?>” > /var/www/html/index.php
# chown apache.apache /var/www/html/index.php

# systemctl restart httpd.service

# ifconfig eth0 | grep broadcast | awk ‘{ print $2 }’
(Your IP address to use for the next step)

Open your browser and visit http://your.ip.address/index.php and if everything executed correctly, you should see a page of php information similar to the image below.