37

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 here. Just enter simple command: step 2 : ls -l If you can find something like ‘indexer.php‘, that’s what we need and we can go on. To see the status of all ...


34

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 new module installation 4. After upgrade magento version. What will do setup:upgrade command 1) Check module version in setup_module table 2) If ...


33

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 is to have something that would at least run reasonably when deployed directly from the downloaded code without further intervention. By running php bin/...


26

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 affect other processes or applications because it cleans only the cache that Magento uses. Disabled cache types are not cleaned. Flushing a cache type purges the ...


18

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 @MagentoImagine2016


18

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/indexer.php -reindex catalogsearch_fulltext php yourmagentofolder/shell/indexer.php -reindex catalog_category_flat php yourmagentofolder/shell/indexer.php -...


16

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 well refered solution to this exception. There is a link to the original Community Forum post: Email template with block It seems that this solution, as quoted ...


14

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


11

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 code in this file system('php bin/magento cache:status'); // you can change it to your command And run this script with http://your base url/custom.php It ...


11

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 cleans only the cache that Magento uses. Disabled cache types are not cleaned. php bin/magento cache:flush Flushing a cache type purges the cache storage, which ...


11

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 you can give path of php like /opt/lampp/bin/php bin/magento to run the magento command. bin/magento bin/magento command will find the golbal php variable and ...


10

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 and css files. To switch back to default mode, open:- app/etc/env.php And change:- 'MAGE_MODE' => 'developer', Back to:- 'MAGE_MODE' => 'default', And re-...


7

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. Ref: http://symfony.com/doc/current/components/console/introduction.html#calling-an-existing-command protected function execute(InputInterface $input, ...


7

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: php bin/magento cache:flush Magento 2 static content deploy Command: php bin/magento setup:static-content:deploy Magento 2 check developer mode Command: ...


7

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


7

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/team use something like bin/magento cache:clean. This way you can execute the command directly from the terminal. Here is a simple hello world command. Before ...


6

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/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <!-- Add this for sending email via cli -...


6

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.


6

This means the php not set as a Environment Variable. So it must be tried with a full path with php: /opt/lammp/bin/php Reference


5

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


5

If you have upgraded to Magento version 2.2.* then var/generation has been moved to generated/code and var/di has been moved to generated/metadata There shouldn't be var/di and var/generation folders after the upgrade.


4

Magento have different strategy to materialize static assets.Copy and Link. When you run setup:static-content:deploy this command use Copy strategy and file will be materialized in static folder and will not not change when you change original. If you cleanup static folder and open page in browser Link strategy will be used and link on original file ...


4

For now you only have this way to apply changes. Magento should be apply changes to pub/static dir but it not. This still know bug. Hope it should be fix soon You can apply new changes by command as like you do. This way will take some times but should work My way when i modify js from my extension . I just go to pub dir and clear folder \pub\static\...


4

I think you have forgot about the -- in front of the command. (So it seems in your screenshot).


4

php magento/bin cache:clean : It cleans a cache type = deletes all items from enabled Magento cache types only. This option does not affect other processed or applications because it cleans only the cache that Magento uses. Disabled cache types are not cleaned. Equivalent of clicking the Flush Magento Cache button in the backend. To use when a modification ...


4

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/magento module:status | grep VendorName_ | grep -v List | grep -v None | grep -v -e '^$'| xargs php bin/magento module:enable Cheers.


4

You seem to be talking about the php bin/magento CLI tool. This is something that is wonderful and indeed there is one for M1 - however its not built in and you need to add it to your server. Its called Mage Tools (what we call it around the office) install link:: https://github.com/netz98/n98-magerun Is that the answer you were looking for?


4

You need to go to directory where Magento has been installed to run Magento commands. I.e. you need to execute: cd public_html/ before running: bin/magento module:enable Infortis_Base Infortis_Brands Infortis_Cgen Infortis_Dataporter Infortis_Infortis Infortis_Ultimo Infortis_UltraMegamenu Infortis_UltraSlideshow command. Please let me know if the ...


4

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


3

I do not know if you did actually try to execute it with the php library. For example my mistake on local OSX: bin zarun$ magento -bash: magento: command not found But it is actually supposed to be: bin zarun$ php magento Of course take a look at the available commands using the list option: bin zarun$ php magento list


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