How to change Magento 2 configuration using Command Line Interface?

Hello Readers! In this blog, we will be showing you How to change Magento 2 configuration using Command Line Interface? | MageSpark Blog

author avatar

0 Followers
How to change Magento 2 configuration using Command Line Interface?

How to change Magento 2 configuration using Command Line Interface?

Magento offers developers a Command Line Interface (CLI) that allows them to run the default Command-Line functions provided by Magento modules. Here, we will explain how you can change the Magento 2 configuration using the command line.

Before we start, there are some prerequisites to consider while changing the Magento 2 configuration using the command-line interface.

Prerequisites:

Path to the configurationA scope code, which specifies a configuration value for a particular scope.Log in to the admin panel using SSH and go to the Magento root directory.

Set configuration values:

To display the configuration setting value, use the below the code:

php bin/magento config:show [--scope[="..."]] [--scope-code[="..."]] path

Now you can set system-specific configuration values in Magento 2.2.0 - 2.2.3, use:

php bin/magento config:set [--scope="..."] [--scope-code="..."] [-l | --lock] path value

You can now set system-specific configuration values in Magento 2.2.4 and higher by using:

php bin/magento config:set [--scope="..."] [--scope-code="..."] [-le | --lock-env] [-lc | --lock-config] path value

Now set sensitive configuration values using:

php bin/magento config:sensitive:set [--scope="..."] [--scope-code="..."] path value

The default configuration path is // or the custom path you configure tag.

In the case of an incorrect path, this command returns an error. The "wrong/config/path" does not exist.

For More Information, Visit:- https://www.magespark.com/blog/post/how-to-change-magento-2-configuration-using-command-line-interface?utm_source=writeupcafe&utm_medium=article&utm_campaign=july-2022

Top
Comments (0)
Login to post.