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
2answers
33 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\...
0
votes
1answer
541 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/...
0
votes
3answers
284 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 ...
0
votes
0answers
49 views

Magento 2.4.1 currency update hourly by cron or change frequency

I have no problem with manual update currency rate in page Admin > Stores > Currency Rates How to create the cron run to update currency per hour? Here my settings, it's works but not per hour ...
0
votes
1answer
536 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 /...
1
vote
1answer
40 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\...
0
votes
1answer
75 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
1
vote
1answer
252 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 ...
0
votes
1answer
237 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?
0
votes
1answer
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
0
votes
1answer
338 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 ...
1
vote
1answer
57 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 ...
3
votes
3answers
360 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 ...
0
votes
1answer
86 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 ...
-1
votes
1answer
78 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/...
0
votes
0answers
39 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\...
2
votes
1answer
26 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 ...
0
votes
1answer
197 views

Magento Stuck at running command

My Magento command for compile is stuck What should I do and what is the problem??
0
votes
0answers
30 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 ...
1
vote
1answer
258 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 ...
0
votes
1answer
41 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.
2
votes
2answers
2k 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.
0
votes
2answers
780 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?
0
votes
0answers
23 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\...
2
votes
3answers
550 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.
1
vote
2answers
290 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 ...
-1
votes
1answer
200 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,
2
votes
3answers
279 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
2
votes
3answers
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...
0
votes
3answers
130 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
0
votes
0answers
48 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\...
0
votes
1answer
106 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....
2
votes
1answer
1k 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
30 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
1k 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
59 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
280 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
65 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
513 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
183 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
173 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 ...
1
vote
2answers
144 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::...
2
votes
3answers
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 ...
6
votes
7answers
10k 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
283 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 ...
1
vote
1answer
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 ...
1
vote
1answer
381 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
74 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
796 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
1k 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-&...