Clever works_

Magento 2 Installation

Magento 2 Installation

Today we will install Magento 2. Why do we need to do this? Previous versions will still work, but Magento will stop supporting these versions in a few years’ time.

It brings database optimization and full page caching which should speed up the data processing. It has LESS preprocessor which is better for front-end developers. Extensions like PayPal are integrated.

 

Firstly we need to download the necessary files from: Magento. Before this, we need to login into our Magento account.

Magento Login

In the download section, we need to choose our format and version, after which we press the download button.

Download Section

After downloading all the files, we need to extract all data into a website folder. If all is configured correctly, we should see the box below:

Download Section

MAGENTO 2 REQUIREMENTS

In the first step we should check our server configuration. Our PHP version needs to be higher than 5.5.22 and MySQL should be 5.6.x.

We need to set always_populate_raw_post_data to -1 in php.ini.

After that we need to enable all extensions by removing the semicolon in php.ini and add writable permissions for the website folder. All official requirements are here.

In the next step, we need to configure our database connection, but beforehand we must create the database. We can use phpMyAdmin or terminal.

Database Configuration

It’s not recommended to use root user, and also remember to use a strong password.

In the third step, we need to configure our store address and admin URL. It’s not recommended to use ”admin” as the admin URL, because it’s easy to guess.

Web Configuration

In Advanced options we can configure https:// options. Apache rewrites to get friendly links, the encryption key and the place where the session is saved.

MAGENTO 2 VIRTUAL HOST

If we are using Magento 2 locally, we need to configure a virtual host like below:

 

In the fourth step, we need to configure the time zone, default currency and default language. After that we need to create an admin account.

Create Admin Account

We will use it later to manage the store. In the last step, we just need to press install button.

Install Now

After that we will see a progress bar. We need to wait around 5 minutes according to your machine. In the last section we will see all information for Magento Admin Info and Database Info.

MAGENTO 2 DATABASE CONFIGURATION FILE

If it’s needed, we can change the database configuration in /app/etc/env.php

MAGENTO 2 CSS AND JS NOT WORKING

If we have an issue that the CSS and JavaScript don’t load, we need to open the terminal and type:

The above command enables you to write static files to the Magento file system when the Magento software is set to production mode.

This command enables you toreindex indexers. After that we need clear the cache. Navigate to var/cache and remove all files.

MAGENTO 2 BROKEN IMAGES

If our images are broken we need navigate to pub/static folder and remove all except the .htaccess file. Next navigate to app/etc/di.xml

and replace.

to

Refresh the website in the frontend and backend. After that, revert di.xml back to its original state.

Related works_

BreakAwayDistributing B2B and B2C
selling platform

The SLK Solutions agency responsible for developing an online store hired us to help them with creating a selling platform dedicated to B2B and B2C clients. BreakAwayDistributing – agency operating from 1993 with main office located in Hamilton, Canada offers high quality products

Learn more

Internet flower shop
from SLK Solutions

SLK Solutions is an IT agency operating in the USA, which helps small and large business owners to implement new technologies. They asked us to support them with our experts with the complete implementation of an eCommerce project for their client.

Learn more