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
26 views

How I can load the Product repository without using the dependency injection?

I made my own command to seed a table: namespace MageGuide\FirstModule\Console\Command; use MageGuide\FirstModule\Model\BlogPost; use MageGuide\FirstModule\Model\ResourceModel\BlogPostResource; use ...
Dimitrios Desyllas's user avatar
1 vote
3 answers
320 views

Many of the commands are missing in CLI

I have installed a latest magento version 2.4.6 on my machine. The setup is complete, but I can not able to execute most of Magento's commands. If I do php bin/magento it gives me only below list of ...
Jaimin Sutariya's user avatar
0 votes
2 answers
21 views

What's is quickly method to deploy assets ? With setup:static-deploy?

In this blog I reference just options and argument https://blog.simon-axilais.fr/decouvrez-la-commande-magento-2-setupstatic-contentdeploy/. And for quickly deploy what's is a best method ? Thanks you ...
Simon Axilais's user avatar
0 votes
1 answer
87 views

How to configure php-fpm in magento2.4.4 on CentOS server

after upgrading magento version , commands not working. https://prnt.sc/OOxHHF7WVLyR
kiran's user avatar
  • 527
2 votes
0 answers
91 views

Magento 2 Console command by using virtualTypes

I tried this solution but the arguments are empty when I debug the command class. It should be possible to create command classes by using a virtualType, no? The constructor arguments are empty in ...
den3988's user avatar
  • 21
0 votes
1 answer
579 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 ...
Stefan Teunissen's user avatar
0 votes
0 answers
140 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 "...
Jaydip Patel's 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 ...
Rui Silva's user avatar
  • 374
0 votes
1 answer
438 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('...
NoOn's user avatar
  • 65
0 votes
2 answers
489 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\...
Arjun's user avatar
  • 3,526
0 votes
1 answer
3k 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/...
Zuby's user avatar
  • 348
0 votes
3 answers
2k 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 ...
jojo's user avatar
  • 129
0 votes
1 answer
1k 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 /...
junaidh's user avatar
  • 49
1 vote
1 answer
201 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\...
Manjunath's user avatar
  • 177
1 vote
1 answer
932 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
Yasir Minhaj's user avatar
1 vote
2 answers
1k 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 ...
Jackom's user avatar
  • 421
0 votes
1 answer
1k 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?
Arsalan Ul Haq's user avatar
0 votes
1 answer
15 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
2k 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 ...
Herve Tribouilloy's user avatar
1 vote
1 answer
216 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 ...
chanchal's user avatar
  • 397
3 votes
3 answers
1k 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 ...
John's user avatar
  • 827
2 votes
1 answer
186 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 ...
Mr. Nanhe's user avatar
  • 129
-1 votes
1 answer
147 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/...
Nafsss's user avatar
  • 720
0 votes
0 answers
168 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\...
jojo's user avatar
  • 129
2 votes
1 answer
97 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 ...
Paul Canning's user avatar
0 votes
1 answer
592 views

Magento Stuck at running command

My Magento command for compile is stuck What should I do and what is the problem??
Anonymous Record's user avatar
0 votes
0 answers
67 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 ...
Sayyed Hasan's user avatar
1 vote
1 answer
488 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 ...
Ghulam Akbar's user avatar
0 votes
1 answer
46 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.
Ramesh R's user avatar
  • 141
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.
irshad's user avatar
  • 171
0 votes
2 answers
2k 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?
temper's user avatar
  • 974
0 votes
0 answers
30 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\...
cs221313's user avatar
2 votes
3 answers
643 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.
Chirag Parmar's user avatar
1 vote
2 answers
420 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 ...
Hardik Makwana's user avatar
-1 votes
1 answer
533 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,
Priya's user avatar
  • 325
2 votes
4 answers
313 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
Priya's user avatar
  • 325
2 votes
3 answers
2k 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...
Vishal Baraiya's user avatar
0 votes
3 answers
159 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
Punith's user avatar
  • 61
0 votes
0 answers
52 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\...
Masud Shaikh's user avatar
  • 1,159
0 votes
1 answer
134 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....
Mr. Nanhe's user avatar
  • 129
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 ...
Nicholas Chow's user avatar
1 vote
0 answers
77 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?
groy's user avatar
  • 331
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"&...
Shoaib Munir's user avatar
  • 9,284
1 vote
0 answers
81 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 ...
Siva's user avatar
  • 1,124
0 votes
0 answers
384 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 ...
Ajwad Syed's user avatar
  • 1,591
0 votes
3 answers
103 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 ...
Siva's user avatar
  • 1,124
0 votes
4 answers
868 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 ...
Aadii Mughal's user avatar
2 votes
2 answers
212 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/...
Aadii Mughal's user avatar
1 vote
1 answer
224 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 ...
Prathap Gunasekaran's user avatar
1 vote
2 answers
538 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::...
PhantomS's user avatar
  • 503