Hot answers tagged

42

Setup upgrade: php bin/magento s:up Cache Flush: php bin/magento c:f Disable Cache: php bin/magento c:d Enable Cache: ​​​​​​php bin/magento c:e Static Content Deploy: php bin/magento s:s:d Di Compile: php bin/magento s:d:c Var clean folder: php bin/magento v:c Uninstall Magento application: php bin/magento s:un Runs cron job ...


16

Available commands: php bin/magento list php bin/magento l admin php bin/magento admin:user:create php bin/magento a:u:c php bin/magento admin:user:unlock php bin/magento a:u:u cache php bin/magento cache:clean php bin/magento c:c php bin/magento cache:disable php bin/magento ...


15

If you enabled one or more modules, then you will need to run magento setup:upgrade to update the database schema. By default, magento setup:upgrade clears compiled code and the cache. Typically, you use magento setup:upgrade to update components and each component can require different compiled classes. magento setup:upgrade --keep-generated The optional ...


14

Search for the missing class in your magento2 code, you can do via linux cli: grep -rnw '/path/to/magento2-root' -e 'Magento\\Email\\Model\\Source\\Variables' and comment any line calling this class (that was removed from magento2.3) UPDATE You can also change this class in Magento 2.3 for Magento\Variable\Model\Source\Variables


8

I added some shortcuts command here. 1. Setup Upgrade Command Line php bin/magento setup:upgrade ==> php bin/magento s:up 2. Cache Command Line php bin/magento cache:clean ==> php bin/magento c:c php bin/magento cache:disable ==> php bin/magento c:d php bin/magento cache:enable [cache_type] ==> php bin/magento c:e [cache_type] php ...


6

There is this blog post by our friend Alan Storm, which most people seems to be using. The problem is this really doesn't work properly here's why. DON'T Use setAreaCode or getAreaCode in the __constructor. This is bad! When you run a command, magento builds the list of all commands available in the system and then does a check to see if the requested is ...


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.


5

Trick : use php bin/magento, this will output all commands with their purpose So : dev:source-theme:deploy = Collects and publishes source files for theme.


4

This issue generally occurs when you keep backup folders in module/theme view files app/code/{{namespace}}/{{module}}/view or app/design/... Remove backup files and try again, it would be working fine.


4

admin php bin/magento admin:user:create php bin/magento a:u:c php bin/magento admin:user:unlock php bin/magento a:u:u cache php bin/magento cache:clean php bin/magento c:c php bin/magento cache:disable php bin/magento c:d php bin/magento cache:enable php bin/...


4

Use this command to create symlinks to LESS files. Please check below URL which will help. URL: https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-less-sass.html


3

ObjectManagerProvider.php is the starting point of initializing all commands with application run setup/src/Magento/Setup/Model/ObjectManagerProvider.php Here createCliCommands() function creates cli commands and initialize them with application instance createCliCommands() function gets list of command instances from getCommands() function which ...


3

List of magento 2 commands shortcut. Setup Upgrade php bin/magento s:up If you don’t want to remove pub/static files while installing/updating database then use following command. php bin/magento s:up --keep-generated Cache Clean php bin/magento c:c Cache Flush php bin/magento c:f Disable Cache php bin/magento c:d Enable Cache php bin/...


3

Run below command: Static content deploy: php -dmemory_limit=6G bin/magento setup:static-content:deploy Cache flush: php -dmemory_limit=6G bin/magento cache:flush Setup Upgrade: php -dmemory_limit=6G bin/magento setup:upgrade


3

This command runs to create symlinks to LESS files in project. dev:source-theme: deploy: Collects and publishes source files for the theme. Example: To create LESS files for the frontend theme named VendorName/themeName in the en_US locale using a CSS file named <magento_root>/pub/static/frontend/VendorName/themeName/en_US/css/styles-l.css, ...


3

Give permission to generated folder from Terminal. Use below command chmod -R -v 777 generated After that run compile command and let me know if it's works.


2

A good place to start is with the official documentation from Magento. I personally like the work that Alan Storm did with this series of tutorials about the object manager. Even though it's not focused on creating and using the new CLI, it's a great place to learn how to construct commands and how to read the code that does the construction.


2

You can use -n parameter to disable interactive mode and assume yes. -n, --no-interaction Do not ask any interactive question So, your final command will be bin/magento setup:config:set --http-cache-hosts=172.xx.xx.xx -n


2

I just replaced the class Magento\Email\Model\Source\Variables with Magento\Variable\Model\Source\Variables.


2

Add this to the di.xml file <type name="Vendor\ModuleName\Command\OrderQueue"> <arguments> <argument name="state" xsi:type="object">Magento\Framework\App\State\Proxy</argument> <argument name="orderCron" xsi:type="object">Vendor\ModuleName\Order\Proxy</argument> </arguments> </type> ...


2

I have one other way. You can use this code : Create di.xml file and add this below code : <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\Console\CommandList"> <arguments> ...


2

You can use this command magento theme:uninstall You can also define a theme path like below, you can add --backup-code to take backup magento theme:uninstall frontend/Magento/blank --backup-code You can Remove themes from the theme database table. Hope it Helps.


2

You can update your magento version using following command composer require magento/product-community-edition=2.3.3 --no-update and then composer update after composer update finished run setup:upgrade Ref: Dev docs


2

Please, check that interceptor class on your server: ls -la generated/code/Magento/Webapi/Model/Cache/Type/Webapi/Interceptor.php (from Magento root dir.) In case it has a wrong permissions change it according your needs (usually make it accessible by web-server user is enough). Another case that interceptor class used somewhere in your code directly (or ...


1

I'm not sure what $item is, but I can explain what the methods that start with uns do. If your $item is an instance of a class that inherits Magento\Framework\DataObject and you have no method defined called unsEquipmentName calling $item->unsEquipmentName() is equivalent to $item->unsetData('equipment_name'). This does not affect you database. It just ...


1

Dirty Hack Rename registration.php file of module which is causing problem for compilation. ;)


1

You can use php's system function to resolve your problem. Create a php file, command.php in your magento's root and put following code in it ; <?php system("php bin/magento inderxer:reset"); system("php bin/magento inderxer:reindex"); Hit the php file through your browser by hitting yourstoreurl.com/command.php, you will execute the commands mentioned ...


1

Helpful shortcuts for bin/magento


1

The command 'module:status' has been declared in setup/src/Magento/Setup/Console/Command/ModuleStatusCommand.php Use a grep command to find out in which module the Console Command is declared: grep -r 'module:status' vendor/magento/ and then in this case it is in magento2-base setup which will be placed in the setup folder during installation.


1

You need to add your custom console command to OS crontab. crontab -u <Magento file system owner username> -e For example, crontab -u magento_user -e Then add your commands with time interval in the end of the file as save, * * * * * <path to php binary> <magento install dir>/bin/magento your_command:your_sub_command For example, * * *...


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