web analytics

Blog

Magento2: Configuration File

Tags: magentomagento2magneto 2

Published on: February 5, 2016 by Afsal

Magento2: Configuration File

Scenario:

Magento is the most popular e-com application and is widely used for millions of online stores. Due to its wide acceptance and popularity, each change in the application invokes high levels of curiosity and confusion to some.  The recent upgrade Magento2 is quite effective but creates some confusions as Magento 2 configuration file is a bit different than of previous versions.

Here I am trying to give you some insights about the Magento 2  configuration file changes and the corresponding changes in the overall behavior of the application.

Main configuration file change

The configuration file of older versions of Magento which contained the database information, admin URL information, etc.. was located at <magento root>/app/etc/local.xml .

In Magento 2 the similar configuration file is located at <magento root>/app/etc/env.php

 root@server [/home/server/public_html/magento2]# cat ./app/etc/env.php 

Sorry guys, I am not gonna reveal my configuration file :-)) . Since it is big file , let us focus more into the areas where both of us are more interested.

admin_url

I assume that you are familiar with Magento application and what is the relevance of “admin_url” . You can identify the admin interface access URL of Magento from the configuration file app/etc/env.php as well


'backend' =>
array (
'frontName' => 'admin_mg',

),

The admin url name is specified at the following part. ‘admin_mg’ is the url name, i.e, go to magento_base_url/admin_mg to get the Admin login page.

Here in my case the the URL is https://domain.com/store/admin_mg

Database Details

The database details are specified at the following part

'db' =>
array (
'table_prefix' => '',
'connection' =>
array (
'default' =>
array (
'host' => 'localhost',
'dbname' => 'server_magento2',
'username' => 'server_mage2',
'password' => 'password',
'active' => '1',
),
),
),

Magento Mode

The current Magento mode is specified in the following part, i.e, production or developer mode.

'MAGE_MODE' => 'production',

Cache Types

The cache types that are currently enabled and disabled are specified here. That is, 1 for enabled and 0 for disabled.

'cache_types' =>
array (
'config' => 1,
'layout' => 1,
'block_html' => 1,
'collections' => 1,
'reflection' => 1,
'db_ddl' => 1,
'eav' => 1,
'config_integration' => 1,
'config_integration_api' => 1,
'full_page' => 1,
'translate' => 1,
'config_webservice' => 1,
'compiled_config' => 1,
),

modules
The list of modules that are currently enabled and disabled can be obtained from the file /app/etc/config.php. The 1 denotes enabled modules and 0 denotes disabled modules.

root@server [/home/server/public_html/magento2/bin]# cat ../app/etc/config.php
< ?php return array ( 'modules' =>
array (
'Magento_Store' => 1,
'Magento_AdvancedPricingImportExport' => 1,
'Magento_Directory' => 1,
'Magento_Theme' => 1,
'Magento_Backend' => 1,
'Magento_Backup' => 1,
'Magento_Eav' => 1,
'Magento_Customer' => 1,
'Magento_BundleImportExport' => 1,
'Magento_CacheInvalidate' => 1,
'Magento_AdminNotification' => 1,
'Magento_Indexer' => 1,
'Magento_CmsUrlRewrite' => 1,
'Magento_Config' => 1,
'Magento_ConfigurableImportExport' => 1,
'Magento_Msrp' => 1,
'Magento_Contact' => 1,
'Magento_Cookie' => 1,
'Magento_Cron' => 1,
'Magento_CurrencySymbol' => 1,
'Magento_Bundle' => 1,
'Magento_CustomerImportExport' => 1,
'Magento_Deploy' => 1,
'Magento_Developer' => 1,
'Magento_Dhl' => 1,
'Magento_Usps' => 1,
'Magento_Variable' => 1,
'Magento_Version' => 1,
'Magento_Webapi' => 1,
'Magento_Weee' => 0,
'Magento_CatalogWidget' => 1,
'Magento_Wishlist' => 1,
),
);

Thank you for your time 🙂

Category : Linux, magento

Afsal

Afsal

Afsal is a tech enthusiast who is always ready to learn new technologies and explore new territories. Although his current focus revolves around the System Administration world, his never ending passion for technologies always keeps him active in other areas as well. He is currently working as a Systems Engineer at SupportSages.

You may also read:

Comments

Add new commentSIGN IN

Let's Connect

Get new updates

Categories

$0.000 items