183 votes
Accepted

How to disable Two factor Authentication module in Magento 2.4

please run below command in terminal Magento root path : bin/magento module:disable Magento_AdminAdobeImsTwoFactorAuth Magento_TwoFactorAuth bin/magento cache:flush
Vishal Baraiya's user avatar
56 votes
Accepted

Magento 2: When should I run which commands?

You only need to run setup:upgrade command 1. When you made changes in Setup script(InstallData, InstallSchema, UpgradeData, UpgradeSchema, ...) 2. If you install Magento first time. 3. At the time of ...
Prince Patel's user avatar
  • 22.7k
51 votes
Accepted

How to reindex Magento 1.x by using command line

step 1 : cd [MAGENTO_ROOT]/shell/ You should replace [MAGENTO_ROOT] with your own absolute path to Magento root folder. For example /home/Thief/public_html/ Then list all files to see what we have ...
Prakash Patel's user avatar
50 votes
Accepted

500 after install - Class Magento\Framework\App\ResourceConnection\Proxy does not exist

chown -R www-data:www-data /var/www/magento2/ chmod 777 -R var generated app/etc rm -rf var/cache/* var/page_cache/* var/generation/* and php bin/magento setup:di:compile; If you're using Docker, ...
stnc's user avatar
  • 648
40 votes
Accepted

Magento 2: What is difference between Cache Clean & Cache Flush?

To purge out-of-date items from the cache, you can clean or flush cache types: Cleaning a cache type deletes all items from enabled Magento cache types only. In other words, this option does not ...
Suresh Chikani's user avatar
33 votes
Accepted

Why can't one switch back to the default mode on Magento 2?

The default mode is neither here nor there. The Magento team really wants you to use either Production Mode on your live site or Developer Mode during Development. The reason why Default Mode exists ...
Kristof at Fooman's user avatar
27 votes
Accepted

How to debug Magento 2 code when using command lines?

I configured "PHP Remote Debug" in PHPStorm and just add XDEBUG_CONFIG before script to start debugging. like XDEBUG_CONFIG=idekey=phpstorm bin/magento setup:upgrade
KAndy's user avatar
  • 20.8k
21 votes

How to reindex Magento 1.x by using command line

You can use Go to shell folder and run this cmd php indexer.php --reindexall For separate php yourmagentofolder/shell/indexer.php -reindex catalog_product_attribute php yourmagentofolder/shell/...
Sagar Dobariya's user avatar
20 votes

Why can't one switch back to the default mode on Magento 2?

The default mode is there only to install Magento 2. It should not be used for development or production. After installation you can only switch between dev and prod. Source: Alan Kent @...
Marius's user avatar
  • 198k
19 votes

How to disable Two factor Authentication module in Magento 2.4

Mark Shust created a module for this purpose which is developer-friendly while keeping secure defaults in place; ref his comments about it
benmarks's user avatar
  • 16.7k
17 votes
Accepted

Magento 2 How to Create a Custom Console Command

I've created several useful commands, which are useful for us who develop Magento 2 sites on a daily basis. Magento 2 console commands are based on symphony, you can create commands for your personal/...
André Ferraz's user avatar
17 votes
Accepted

Magento2 - Command-Line - Sending Email Using Block Templates - Error: Missing required argument $debugHintsPath

I finally found the solution to this problem in the Magento Community Forums, which was provided by @dunagan5887. I decided to share it here on magento.stackexchange.com as many may benefit from a ...
ElGatito's user avatar
  • 890
16 votes

How to disable Two factor Authentication module in Magento 2.4

For magento 2.4.6 to disable Two Factor Authentication module php bin/magento module:disable {Magento_AdminAdobeImsTwoFactorAuth,Magento_TwoFactorAuth} php bin/magento setup:upgrade php bin/magento ...
MY-Dev's user avatar
  • 171
14 votes
Accepted

How to install module magento 2 don't need run command line bin/magento setup:upgrade

I think system() function will be your friend, if you don't have permission of CLI. To use this function , just simple create new file in your root server(Let's call it custom.php), then write below ...
Keyur Shah's user avatar
  • 18.1k
14 votes

Magento 2: What is difference between Cache Clean & Cache Flush?

php bin/magento cache:clean Cleaning a cache type deletes all items from enabled Magento cache types only. In other words, this option does not affect other processes or applications because it ...
Rafael Corrêa Gomes's user avatar
13 votes
Accepted

enable multiple modules for same namespace

You cannot use wildcards but you can enable all of them from one command like this: php bin/magento module:enable Vendor_MyModule1 Vendor_MyModule2 Vendor_MyModule3
Marius's user avatar
  • 198k
13 votes

enable multiple modules for same namespace

Short answer: Yes, you can. But it is *nix command trick, Magento 2 does not support it by default as Marius answer. You can execute the following command and it can do what you want. php bin/...
Toan Nguyen's user avatar
  • 3,049
13 votes
Accepted

Difference between php bin/magento and bin/magento

There is no difference between these two command. php bin/magento php bin/magento command you are using php global variable to run command. for example if you are not set the global variable then ...
Addify's user avatar
  • 769
11 votes

Why can't one switch back to the default mode on Magento 2?

As a windows developer, in developer mode, Magento wants to create symbolic links to the static assets, but uses the Linux command and not the windows command. This creates a lot of errors in the js ...
Dallas Clarke's user avatar
10 votes

500 after install - Class Magento\Framework\App\ResourceConnection\Proxy does not exist

Delete composer autoload (vendor/autoload.php) as suggested by @JELLEJ and type composer install in magento root folder to recreate it. It worked for me on Magento 2.3.5-p1 (but should work in other ...
Ricardo Martins's user avatar
10 votes
Accepted

Magento 2 - bin/magento No commands working - Class 'Cli' not found Error

You are missing the composer.lock file and you must run the commands: composer update After you ran the above command, you can run the command: php bin/magento setup:upgrade
St3phan's user avatar
  • 2,907
9 votes
Accepted

How to inject Magento 2 commands in custom command?

Short answer is yes you can do what you want. The Magento console commands are built using Symfony (as you probably are aware). The following is the example taken directly from the documentation. ...
Smartie's user avatar
  • 3,240
8 votes

enable multiple modules for same namespace

You can use the the --all flag to enable all available modules php bin/magento module:enable --all This of course is if you don't mind enabling all modules. Tested in magento 2.1.x
Xenocide8998's user avatar
  • 1,772
7 votes

Magento 2: Controlling M2 via command line – when and why to use each command

I am sharing some magento 2 useful commands here: Magento 2 Upgrade Command: php bin/magento setup:upgrade Magento 2 reindex Command: php bin/magento indexer:reindex Magento 2 flush cache Command:...
Purushotam Sharma's user avatar
7 votes

Magento2 - Command-Line - Sending Email Using Block Templates - Error: Missing required argument $debugHintsPath

As CLI in Magento doesn't have an appropriate area, I figured out the following workaround: app/code/NameSpace/Module/etc/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/...
rut4's user avatar
  • 111
7 votes

Magento Command Line Global Commands

Another method would be to use alias touch ~/.bash_profile nano ~/.bash_profile then add alias magento="php bin/magento" Log out and back in or run source ~/.bash_profile You could change '...
MagePal Extensions's user avatar
7 votes
Accepted

How to activate and setup full page caching using Varnish from command line

Use: php bin/magento config:set system/full_page_cache/caching_application 2 And follow the same patterns for the other paths, like so: php bin/magento config:set system/full_page_cache/varnish/...
Steve K's user avatar
  • 186
6 votes
Accepted

magento 2: 'i18n:collect-phrases' command creates different csv files

The CSV with 4 columns is the global CSV for all modules. That's why it contains 3rd column as module and 4th column as Module_Name.This file should be placed in i18n folder parallel to app. The CSV ...
Gulshan's user avatar
  • 569
6 votes

Command line error stock magento

The problem was in app/etc/env.php file which was empty. I restored the content of this file with the local data and it started working again.
Char's user avatar
  • 337
6 votes
Accepted

Magento 2 Terminal Progress bar while uploading csv file from terminal

I found that Magento 2 itself using Symfony packages which is very flexible and we can customize it as per our need basis if you are in confusion to use it then only put this code in your Command ...
Manish Goswami's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible