How to install Magento 2 in CentOS – Part 02

We need to install and configure Linux, Apache, MariaDB and PHP to install Magento on CentOS 7. In a word, LAMP.  As we’re already using a Linux Server. Here we’ll begin with the Apache installation.

Install Magento on CentOS 7 – Apache

In this case following command will install Apache in our system.

sudo yum install httpd -y

Here Note, it’s always recommended to use latest MariaDB server. But CentOS 7 has no MariaDB 10 inside it’s default repository. Next the following is the command to add repository in to CentOS 7 for MariaDB 10.

sudo nano /etc/yum.repos.d/mariadb.repo

Also include these following lines:

[mariadb]

name = MariaDB

baseurl = http://yum.mariadb.org/10.1/centos7-amd64

gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB

gpgcheck=1

Now simply Save the file. Next for updating the MariaDB repo use the following command:

sudo yum update -y

After completing the update we’re ready to install MariaDB. So, use the below command to install MariaDB.

sudo yum install mariadb-server

Right after that we’ll start both of our Apache web server & MariaDB. By following commands we’ll also enable them to start on boot.

sudo systemctl start httpd

sudo systemctl start mariadb sudo systemctl enable httpd sudo systemctl enable mariadb

Magento supports PHP versions from PHP 5.6 to PHP 7.1. We will install PHP 7 and other required modules for Magento.

Install Magento on CentOS 7 – PHP 7

Simply run these following commands to install the PHP 7 and all other modules.

sudo yum install -y http://dl.iuscommunity.org/pub/ius/stable/CentOS/7/x86_64/ius-release-1.0-14.ius.centos7.noarch.rpm
sudo yum -y update sudo yum -y install php70u php70u-pdo php70u-mysqlnd php70u-opcache php70u-xml php70u-mcrypt php70u-gd php70u-devel php70u-intl php70u-mbstring php70u-bcmath php70u-json php70u-iconv

After completing the installation it’s time to verify the PHP version. So, use the following commands to verify PHP version.

php -v

Now we’ll see following output for PHP 7.

PHP 7.0.13 (cli) (built: Nov 10 2016 08:44:18) ( NTS )

Copyright (c) 1997-2016 The PHP Group

Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies

with Zend OPcache v7.0.13, Copyright (c) 1999-2016, by Zend Technologies

In the next part of the article, we’ll increase the PHP limit to continue with installation.

Now Reading Part 02 | Part 01 | Part 03 | Part 04 | Part 05