Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [command]

Command is a short hand for the built in Command Line tools (or CLI) in Magento 2, the custom CLI tools made for Magento 1 or other actions that are executed on a Magento site using the Command Line (i.e. the Terminal application for mac) when logged into a server with SSH.

2
votes
1answer
67 views

How to run command CLI in Magento 2

I'm facing the same problem as MagentoProblem this link. It is about messy frontend and backend of Magento 2. This happened after i set https://(My_Domain_Name).com into Configuration > Web > Base ...
1
vote
0answers
19 views

how to run linux command in magento1

How to run below linux command in Magento 1 under observer/model? grep -n 'tracker' test.txt which can be later used for cron?
3
votes
2answers
100 views

Magento 2 - Custom shell command not working

I want to execute some code using custom command like: php bin/magento mycommand:dothis To enable this command I have added this code in di.xml <type name="Magento\Framework\Console\CommandList"&...
1
vote
0answers
23 views

What's the difference between flush the cache from admin panel and through command?

I have seen that we can flush the Magento cache via admin panel System> Cache Management and as well as by running the below command php bin/magento cache:flush I would like to know what's the ...
0
votes
0answers
35 views

How to create custom module after installing Magento 2 Docker Image?

I have installed Magento docker Image and frontend, backend is working fine. The directory structure of Magento docker Image installed is: Now I am looking how to start my first module. I have these ...
0
votes
3answers
53 views

When to run compile command in Magento?

I have updated the CSS for our site. After updating, I ran the below commands: php bin/magento setup:static-content:deploy -f php bin/magento cache:flush But the changes are not applied when I ...
0
votes
4answers
37 views

Magento 2 indexer:reindex Command Not Working

when i run command php bin/magento indexer:reindex it don't reindex all indexers. but when i run php -dmemory_limit=6G bin/magento indexer:reindex the the following error Please advice your ...
2
votes
2answers
107 views

Magento Commands Not working

Any one can help will be highly appriciated, i'm running magento 2.2.6 Deprecated Functionality: The each() function is deprecated. This message will be suppressed on further calls in /home/...
1
vote
1answer
51 views

Magento 2 : Area code must be set before starting a session?

We have a custom console command and it was working fine in Magento 2.2.7 , when we move this extension to Magento 2.3 it failed when we running setup:upgrade. The Code : <?php ...
1
vote
2answers
24 views

Magic Method unsItemName()

I'm trying to use an unset magic method to delete a row from the table. Following is the line of code from execute method of my CLI command. $item->unsEquipmentName($input->getArgument(self::...
0
votes
3answers
348 views

Magento 2.3 Useful SSH CLI Commands List [duplicate]

list of magento 2 SSH CLI Commands what is magento ssh cli command for Upgrade? what is magento ssh cli command for Cache Clean? what is magento ssh cli command for Cache Flush? what is magento ...
5
votes
5answers
1k views

Magento 2 Setup di Compile Problem

After I upgraded to Magento 2.3, running the command setup:di:compile, I get this error: Area configuration aggregation... 5/7 [====================>-------] 71% 58 secs 276.0 MiB In ClassReader....
3
votes
2answers
192 views

Can anyone please explain how the all magento command work in magento2(I want to undesrstand backend process)?

Can anyone please explain how the all magento command work in magento2(I want to understand backend process) Like: IF I am running command php bin/magento module:status which file will affect and ...
0
votes
1answer
269 views

Magento 2: How to Call a Console Command from a Custom Cron job?

I'm working on a custom Cron and I want find the best way to call other commands from the Cronjob code in magento2 (programmatically). For example: When running cli "php bin/magento cache:clean" and ...
1
vote
1answer
158 views

Magento 2.2.5 shell script PHP Memory size of 2097152 bytes exhausted (tried to allocate 32768 bytes)

I have a magento 2 script which runs through shell so to not have a timeout issue. It uses php multi curl request and it was running fine. But recently asked our hosting server to increase the PHP cli ...
2
votes
1answer
65 views

Commands for correct deploy

What are the basic commands to be executed for Deploy in Magento 1 and Magento 2 after doing the git pull?
2
votes
2answers
220 views

Magento 2 : Run command line without prompt confirmation

When I run: bin/magento setup:config:set --http-cache-hosts=172.xx.xx.xx I get a command prompt: Overwrite the existing configuration for http-cache-hosts?[Y/n] I want to use this into a bash ...
1
vote
0answers
266 views

Magento 2: How to call a command from a Controller?

I have created a command and now I need to call it from a controller. How to do it? This is the command: class CleanVarnish extends Command { protected function configure() { $this-&...
0
votes
1answer
46 views

Why i ran bin/magento cache:flush after need sudo chmod -R -v 777 generated var pub [duplicate]

I am using 2.2.4 Magento when I ran the this command every time bin/Magento cache:flushafter. I need sudo chmod -R -v 777 generated var pub, if not it will error. how can I Solve this problem, thank ...
0
votes
0answers
51 views

Unable to save product using console command

I have created a custom command to delete all gallery images. When I execute the same code by putting it into the controller and using browser it works well but when I use it inside a console command ...
0
votes
1answer
393 views

Magento 2 : How to solve Catalog Rule Product Status: REINDEX REQUIRED ( NO SSH access )

I have problem with Catalog Rule Product Status: REINDEX REQUIRED. I'm using Magento 2.2.3 & DirectAdmin without SSH access. Also, I triad through Admin panel & it's not working. My Cron-...
16
votes
6answers
6k views

Magento 2 : list of command shortcuts

I need to know the list of useful commands for Magento 2 in short-cut form Can anyone help me?
1
vote
1answer
1k views

Magento 2: How to properly set app state “Area code”? (setAreaCode, getAreaCode)

I see there isn't a lot of information about using app states and if there is it doesn't work properly. So bellow is my answer based on my own investigation.
0
votes
1answer
16 views

Magento2 Frontend and backend doesn't work while executing commands

Whenever I execute setup:di:compile and setup:static-content:deploy commands from SSH, magento2 frontend and backend showing error. My magento2 store in production mode. What should I do before run ...
0
votes
1answer
299 views

Magento compile error php bin/magento setup:di:compile

I am running Magento 2. And my Magento admin is missing CSS also the below error is shown while compiling . syntax error, unexpected '?' in /home/username/public_html/store/vendor/magento/module-...
2
votes
3answers
40 views

Command tutorial

I Magento to avoid commands completely on our first 2 website using Magento1, but it seems like I can't avoid it anymore with Magento2. Where do I start? I can find hundreds of tutorial online but i'm ...
0
votes
2answers
536 views

Magento 2 - When I run any command it gives me error

php -f bin/magento cache:flush php bin/magento setup:upgrade Commands giving this error.Please check this, https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-error For more info on ...
0
votes
2answers
332 views

How to Run magento 2 command without connect putty?

When our Magento 2 on live server and we require to enable disable modules, flush cache , deploy static files etc ,we need to configure SSH. but now not connect my putty so how to run all command
1
vote
1answer
204 views

Magento 2. Command that is executed when admin:user:create is executed

Magento 2 has a console command admin:user:create At a quick search we find a class that defines a command with such a name Magento\Setup\Console\Command\AdminUserCreateCommand Yet putting a ...
0
votes
1answer
386 views

Magento2 deploy command not working and rest commands are working

I have tried to run this php bin/magento setup:static-contnet:deploy command on the magento root folder then it showing the below error "Notice: Undefined offset: 0 in /home/nuluv938/public_html/...
1
vote
2answers
117 views

Cannot add new cli command “Class does not exist” on setup:upgrade

I am trying add custom command for beginning 'hello world'. I'm doing all by guide but always have this error [ReflectionException] Class Hesoy\HelloWorld\Console\Command\HelloWorldCommand ...
3
votes
0answers
45 views

REİNDEX SYMFONY ERROR SCREENSHOT

[![this is my problem][1]][1] CommandNotFoundException ERROR My Screenshot KALİ: https://image.ibb.co/gu6fWb/Screenshot_from_2017_12_29_03_05_41.png HELP THANX GUYS
2
votes
0answers
161 views

Override class in setup:upgrade command in magento2

I am trying to override the class FilePermissions (magento/framework/Setup/FilePermissions.php) but my changes are not taken in account while I use the bin/magento setup:upgrade I tried : To add a ...
0
votes
1answer
235 views

magento sampledata:remove not working

I want to remove sample data or reinstall magento 2.2.1 without sample data i tried below command. php bin/magento sampledata:remove command is not working and throwing below error [Composer\...
1
vote
2answers
337 views

magento 2.2.1 command is not working

I setup a Magento 2.2.1 version and I can't give any command by git bash. when I give Magento common commands it shows error. like this: $ php bin/magento cache:status Magento supports 7.0.2, 7.0....
0
votes
1answer
238 views

reindex command not working

I am trying to reindex using the following command from public_html folder (root directory): php bin/magento indexer:reindex I have even tried bin/magento indexer:reindex I receive the ...
0
votes
1answer
245 views

Delete collection item through console command

My goal is to delete the default shipping address of all customer. The code looks something like this: foreach ($customerCollection as $customer) { $customer->load($customer->getId());...
1
vote
2answers
339 views

Magento Commands - Segmentation Fault (Core Dumped)

I receive the following error when running any of the magento commands in CL? Any ideas on how to resolve? Segmentation Fault (Core Dumped) Thanks
5
votes
2answers
2k views

Command line error stock magento

I get this error after install when trying to clear var/ generation, and static content deploy via command line. [Exception] Warning: Invalid argument supplied for foreach() in /vendor/magento/...
8
votes
2answers
21k views

When exactly to use php bin/magento setup:upgrade

There are lots of situations in which I change some files in my module in the developer mode but the changes didn't take place in frontend until I run php bin/magento setup:upgrade Just wanted to ...
0
votes
3answers
3k views

Running “bin/magento setup:static-content:deploy” gives “Permission denied”

When running: root@ubuntu:/var/www/Magento2# bin/magento setup:static-content:deploy I got -bash: bin/magento: Permission denied please note that I'm running the command using root user