2022 Developer Survey is open! Take survey.

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.

Filter by
Sorted by
Tagged with
0 votes
1 answer
20 views

CLI command without option name

I know how to create custom CLI commands with input parameters like: bin/magento customers:syncbyid --id=69, but I'd like to know how (if even possible) I can create a command with an option without a ...
user avatar
0 votes
0 answers
57 views

magento 2 run comand and error showing it

when I have run upgrade command or run deploy command and below type error coming it php -dmemory_limit=5G bin/magento setup:upgrade Error: Path "." cannot be used with directory "...
user avatar
1 vote
0 answers
22 views

Tabulation added to commands and downloaded file beginning

I don't know when it started happening so I don't know where to look. For example if I run a command it shows like php bin/magento indexer:reindex Design Config Grid index has been rebuilt ...
user avatar
  • 346
0 votes
1 answer
105 views

how to call function from cli command magento 2

How can call function from block to cli command magento 2 here is my cli command class class Hicustomer extends Command { protected function configure() { $this->setName('...
user avatar
  • 31
0 votes
2 answers
167 views

Magento2 error In State.php line 153: Area code is not set

I have created a custom command, when I run upgrade command to install that module getting following error In State.php line 153: Area code is not set Following is my code use Magento\Framework\...
user avatar
  • 3,426
0 votes
1 answer
2k views

Magento 2 installation error Trying to access array offset on the value

When I try to install Magento 2.4.1 I get this error Error happened during deploy process: Notice: Trying to access array offset on the value of type null in /home/609563/public_html/vendor/magento/...
user avatar
  • 338
0 votes
3 answers
695 views

Could not connect to debugging client when running bin/magento commands

I'm using Magento 2.4.1, PHP 7.4, and xdebug 3.0.4. The xdebug is working normally with this setting in php.ini: But whenever I run bin/magento setup:upgrade or any others bin/magento command I ...
user avatar
  • 167
0 votes
1 answer
902 views

How to solve Magento 2 with composer 2 version error when sample data install

My application running AWS Bitnami platform. I am trying to upload sample data using composer after commands show warning message below Do you want to store credentials for repo.magento.com in /...
user avatar
  • 43
1 vote
1 answer
65 views

usage of ShellInterface in Magento 2

I used exec() function to run the magento commands. As exec() is not recommended used the below code . class Test{ protected $_shell; public function __construct( \Magento\Framework\...
user avatar
  • 135
0 votes
1 answer
270 views

Can I run cli commands in magento 2 through button or action or route?

I want to run magento cli commands in magento 2.4.1 through button or action
user avatar
1 vote
1 answer
555 views

Magento 2 setup:di:compile not work

When i try to start command setup:di:compile i see this error: and this is the file FileClassScanner.php: <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license ...
user avatar
  • 285
0 votes
1 answer
586 views

Area code is not set in setup upgrade command installing data

setup upgrade command throws error while Installing data Area code is not set. The issue is coming from webkul core module. Anybody faced similar issue?
user avatar
0 votes
1 answer
14 views

I need to understand the basic compilation command for complication and deployment, what are its functionalities and how do it works?

Upgrade extension files => setup:upgrade Deployment static content => setup:static-content:deploy Generate Classes => setup:di:compile
user avatar
0 votes
1 answer
641 views

update product websites on magento 2 programmatically

I have come across posts to update products websites programmatically for Magento 1. However, I do not find the same for Magento 2. Ideally, a command would really be useful. Can somebody help with ...
user avatar
1 vote
1 answer
61 views

Unable to run magento 2 commands after upgrade

I upgraded magento 2.1.4 to 2.3.5p1. I first upgraded it to 2.2.3 and then to 2.3.5 through command line. After upgrade, I am getting Fatal error: Uncaught InvalidArgumentException: Unable to ...
user avatar
  • 377
3 votes
3 answers
578 views

How to run php function directly after a specific Magento 2 CLI command?

For the sake of simplicity, let's say I want to echo out "Hello World" (in reality i want to do a lot more) directly after anyone runs php bin/magento setup:di:compile. In the latest version ...
user avatar
  • 767
0 votes
1 answer
122 views

How to enable dependency profiling graphs | Magento 2.3

According to this article we can enable dependency profiling graph but did not find any command for the same. As Mentioned on the page - To enable dependency graphs, use the "variable option". See ...
user avatar
  • 109
-1 votes
1 answer
106 views

An exception was raised while creating "Request"; no instance returned magento2 command error

I am trying to execute magento command on my terminal but getting this error "An exception was raised while creating "Request"; no instance returned" I tried running all these commands php bin/...
user avatar
  • 700
0 votes
0 answers
84 views

Custom Console command __cunstructor always gets an error in Magento 2.3

I have a console command class with constrcutor that looks like this: namespace Vendor\Module\Console\Command; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\...
user avatar
  • 167
2 votes
1 answer
38 views

Cannot save custom product attribute via custom console command

I am trying to update a custom product attribute via a custom console command. The command runs, and the product seemingly saves; it never throws an exception or any form of error, yet the attribute ...
user avatar
0 votes
1 answer
355 views

Magento Stuck at running command

My Magento command for compile is stuck What should I do and what is the problem??
user avatar
0 votes
0 answers
35 views

Could not open input file: bin/magneto error after every command in magent2.3.3

I have freshly installed magento 2.3.3 but when i am trying to run indexer or any other command i am getting following errors. Could not open input file: bin/magneto I have tried so many commands ...
user avatar
1 vote
1 answer
358 views

Run multiple cron groups but not all in magento 2

I wanted to run the following way. php bin/magento cron:run --group="test_group1","test_group2","test_group3" OR php bin/magento cron:run --group="test_group1,test_group2,test_group3" What is the ...
user avatar
0 votes
1 answer
43 views

How to upgrade Magento-CE-2.2.10 to Magento-CE-2.3.3 using Composer?

I have magento 2.2.10 CE. I want to upgrade 2.2.10 to 2.3.3 CE with commands only. Does anyone know how to upgrade it with commands? Thanks in advance.
user avatar
  • 121
2 votes
2 answers
3k views

Magento 2: Running any command getting error Class Magento\Webapi\Model\Cache\Type\Web Api\Interceptor does not exist

Running any command s:up , s:di:c s:s:d -f cache getting error Class Magento\Webapi\Model\Cache\Type\WebApi\Interceptor does not exist And like below images, any help will be appreciate.
user avatar
  • 161
0 votes
2 answers
1k views

Magento 2 How to stop particular group cron?

I runned cron command, now all cron group are running. But I wanted to stop my custom group cron. Please tell me how to stop it?
user avatar
  • 934
0 votes
0 answers
29 views

I can only add one command in one module

I have created a command the class is Vendor\CreateProduct\Command\CreateProduct. It could be found when I type: php bin/magento But when I create another command which class is Vendor\CreateProduct\...
user avatar
2 votes
3 answers
595 views

How to upgrade magento 2.3.1 CE to 2.3.3 CE?

I have magento 2.3.1 CE. I want to upgrade 2.3.1 to 2.3.3 CE with commands only. Does anyone know how to upgrade it with commands ? Thanks in advance.
user avatar
1 vote
2 answers
328 views

Magento 2.3.2 Developer mode error in setup:di:compile

I am using the Magento 2.3.2 version. When I run the "setup:di:compile" command then Can't remove directory: directory is not empty error occurred. I have also set the permission of the generated ...
user avatar
-1 votes
1 answer
269 views

What is the use of this Command bin/magento i18n:collect-phrases -m?

What is the use of this below command? bin/magento i18n:collect-phrases -m explain me briefly. Thanks,
user avatar
  • 197
2 votes
3 answers
290 views

What is the use of command?

php bin/magento dev:source-theme:deploy What is the use of this above command? Explain briefly. Thanks
user avatar
  • 197
2 votes
3 answers
1k views

How Uninstall Theme Using command line in Magento 2

How to uninstall or remove a theme using the command line In Magento 2. Thank You...
user avatar
0 votes
3 answers
148 views

Error while running di:compile command

Getting ReflectionException] Class PayPal\Api\PayoutSenderBatchHeader does not exist error while running php bin/magento setup:di:compile command
user avatar
  • 61
0 votes
0 answers
51 views

Magento2: setup:di:compile issue

Got the error below when I run the setup:di:compile command [Magento\Framework\Exception\LocalizedException] Source class "\Magento\Framework\EntityManager\OperationInterface" for "Magento\...
user avatar
  • 1,127
0 votes
1 answer
124 views

Magento 1 : Get product collection using command line throwing error

I have a script file like getproducts.php & have placed it under script/getproducts.php. I want to get products collection in my script file. code in my file: <?php require_once('../app/Mage....
user avatar
  • 109
2 votes
1 answer
2k 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 ...
user avatar
1 vote
0 answers
43 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?
user avatar
  • 311
3 votes
2 answers
2k 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"&...
user avatar
  • 8,795
1 vote
0 answers
62 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 ...
user avatar
  • 1,124
0 votes
0 answers
327 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 ...
user avatar
  • 1,521
0 votes
3 answers
68 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 ...
user avatar
  • 1,124
0 votes
4 answers
665 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 ...
user avatar
2 votes
2 answers
198 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/...
user avatar
1 vote
1 answer
209 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. Anyone who have faced exact similar ...
user avatar
1 vote
2 answers
188 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::...
user avatar
  • 493
2 votes
3 answers
2k 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 ...
user avatar
  • 103
6 votes
7 answers
11k 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....
user avatar
3 votes
2 answers
312 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 ...
user avatar
1 vote
1 answer
2k 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 ...
user avatar
1 vote
1 answer
406 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 ...
user avatar