Questions tagged [cli]

Denotes questions related to CLI which is a short form of Command-Line Interface

Filter by
Sorted by
Tagged with
86
votes
12answers
182k views

Magento 2 Reindexing - One or more indexers are invalid. Make sure your Magento cron job is running

I couldn't find the way to do reindexing in mass actions on magento 2. Seems like you need to run it from cronjob. Is there an alternative way to reindex data in magento 2 from backend or command ...
15
votes
2answers
5k views

How to create custom Module Development in magento 2 from Scratch?

How to create Custom Module Development from scratch in magento 2 with following point. 1.How to Create Module 2.How to Install and Upgrade Database 3.How to Create Module,view and Controller ...
24
votes
5answers
13k views

Magento2 CLI module:enable gives error “Unkown module(s)”

In Magento2 I've built a simple custom module and want to enable it by CLI: bin/magento module:enable Vendorname_Modulename But it is giving me the following error: Unknown module(s): '...
30
votes
4answers
56k views

Magento 2 - There are no commands defined in the “setup” namespace on windows [duplicate]

I have a problem when I run this command: php bin/magento setup:upgrade Display error: [InvalidArgumentException] There are no commands defined in the "setup" namespace. I found some ...
13
votes
11answers
22k views

There are no commands defined in the “setup” namespace : Magento 2

I have installed the latest version of Magento 2, everything is working fine frontend, backend and functionality. I have one issue with bin/magento setup:upgrade command, when I run this command in ...
11
votes
3answers
21k views

Magento 2 : Execute Cron

How can I execute Cron from command line manually. In Magento 1.x we can run cron like : www.testsite.com/cron.php but in magento 2 how can I do this ? Please also help me for how can I execute ...
9
votes
3answers
2k views

Correct, Supported way to Add CLI Commands to Magento 2

Is there a correct, and officially supported way, to add your CLI commands to a Magento 2 module? From what I've gathered your options are Add your command class to the commands argument of Magento\...
8
votes
2answers
6k views

Magento2.3 setup:upgrade error

After being able to update magento to 2.3 (which was a pain by itself) I managed to get to the part where the database needs to be updated. Which is in current state when I try to run the command bin/...
5
votes
3answers
7k views

Magento 2 “Area code not set” warning in 3rd party module

I have a third party extension that i'm trying to install on a Magento 2 site i'm building. When i try and run setup:upgrade i get the error: [Magento\Framework\Exception\SessionException] Area code ...
3
votes
4answers
12k views

How we can install magento 2.2.0 via command line comand?

How we can install magento 2.2.0 via command line command(CLI) using Ubuntu ? Could you please some share command?
5
votes
1answer
3k views

Magento 2: How to fix incorrect permissions after executing setup:upgrade and/or setup:di:compile

After running setup:upgrade and di compile from the bin directory, permission and ownership is reset and the magento store stops working. It works if I manually reset the permission. When the var/...
3
votes
2answers
6k views

Zend_Db_Adapter_Exception pdo_mysql extension is not installed

ralfe@ralfe:/opt/lampp/htdocs/amboim$ bin/magento setup:di:compile Compilation was started. Proxies code generation... 0/7 [>---------------------------] 0% 1 sec 42.0 Mi Proxies code generation.....
1
vote
1answer
745 views

Magento 2 : How to create our own bin script [duplicate]

I am trying to create my own script to be placed in my extension /bin folder so that once I finished it, it should work in this way bin/mycommandname my-customcommand instead of running the ...
6
votes
3answers
5k views

Magento 2: Disable all custom and Third Party Module in single Command

Is there is any way that we can disable all custom and third party Module in a single command? Currently, I am using below command to disable multiple modules php bin/magento module:disable module1 ...
6
votes
2answers
3k views

Magento 2: programmatically run setup upgrade

My Client wants me to write code to : programmatically upload a customized module and then enable the module(php bin/magento module:enable VENDORNAME_MODULENAME) and then upgrade the system(php bin/...
17
votes
3answers
14k views

Magento 2 run a specific Cron without cron:run CLI command?

To make a long story short xdebug will not reliably stop on the breakpoints in my cron files when using the typical: php bin/magento cron:run Xdebug is all setup properly and sometimes it will work ...
3
votes
3answers
6k views

Magento reindex from command line, still having timeout error

I'm trying to reindex my catalog_url_rewrite table (Magento website) through the command line using the command "php indexer.php --reindex catalog_url" in /shell. I get the following error: PHP Fatal ...
4
votes
4answers
127 views

Magento CLI options to check Security patch applied or not?

Is there any CLI options to check security patch is applied or not ? How many are pending. I have tried with online tool magereport and many of patch status is unknown. That is why am asking for a ...
3
votes
3answers
2k views

Magento 2: Controlling M2 via command line – when and why to use each command

When making changes to my Magento 2 site, I usually run a few of the command line commands to 'refresh' my site to see the changes I've made. The problem is, I'm not too sure what each command really ...
4
votes
3answers
5k views

How to configure Magento 2 Theme/Design via the Command-Line?

I'm doing some server configuration related tasks and was looking for a way to configure the theme of a store/website via the command-line. I'm setting up a store with a custom theme (e.g. "Vendor/...
4
votes
1answer
1k views

bin/magento cron:run running for a long time

the bin/magento cron:run entry in my crontab seems to cause a rather high load on the cpu (php's and mysql's cpu usage are permanently both at around 25% each) - I checked by disabling the crontab ...
3
votes
5answers
21k views

PHP Fatal error: Uncaught Zend_Cache_Exception

SOLVED - see my answer below. I changed my theme and all pages showed only html without any styling. Then I ran sudo php bin/magento setup:static-content:deploy and after website doesnt work and ...
2
votes
10answers
8k views

Is there a list of most popular CLI commands for Magento 2?

I am looking for a quick, easy reference for the most popular CLI commands and how they are used in Magento 2.
6
votes
3answers
5k views

Magento 2 bin/magento not working as it should

I've just installed a fresh copy of Magento 2.1.2 from composer. I've previously installed Magento 2 in a different directory completely fine and the commands all run as they should. This has only ...
6
votes
4answers
2k views

Magento 2 compile command fail, but no errors

The compile command suddenly stops, but there is no error. [~/public_html]# php bin/magento setup:di:compile -vvv Compilation was started. Repositories code generation... 1/7 [====>----------------...
4
votes
1answer
5k views

How the “magento setup:store-config:set --base-url” command exactly works?

I was thinking that such command was the same as setting the Base url from the Magento admin panel, from Configuration / Store / Web / Base Urls, but after some try it seems it is not the same. When ...
3
votes
2answers
3k views

Flushing Magento Caches with Magerun

While learning about the diverse caches in Magento (e.g. per Various Magento Cache flushing methods, I was wondering which of these Magerun supports on how the commands would look like?
2
votes
2answers
763 views

How the catalog:product:attributes:clean works?

I have used the below command in Magento CLI, php bin/magento catalog:product:attributes:clean I read the description for this command in forums and stack overflow, they only say Removes unused ...
1
vote
1answer
2k views

Console Command: Area code must be set before starting a session

I am trying to get a list of orders from the OrderRepository (Magento 2.1) via a console command and am using code as follows... ... public function __construct( \Magento\Framework\Model\Context ...
1
vote
5answers
3k views

Magento 2.2 with PHP 7.1.9 Issue

I have a MultiPHP Manager on my WHM and I have installed Magento 2.2 with PHP 7.1.9. However, whenever I execute a simple cli command I receive an error Magento supports 7.0.2, 7.0.4 and 7.0.6 or ...
0
votes
1answer
248 views

Magento 2.3.1 Product EAV index throws error with GTID consistency

when I run reindex Command After Below type error showing SQLSTATE[HY000]: General error: 1787 Statement violates GTID consistency: CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can only be ...
0
votes
1answer
149 views

How to install Magento Cloud CLI?

I'm running a Magento Commerce Cloud in my new machine and I need to install the Magento Cloud CLI. How could I do it?
0
votes
1answer
953 views

Magento 2: How to run CLI command on admin store (storeId:0)?

I have a multi-store setup with Magento 2.1.7 CE on the domain a, domain b, domain c. I want to apply images to some products programmatically. When I make an API call on any domain with the "all" ...
0
votes
3answers
2k views

setup-cron.ERROR: real memory limit 756M but 512M in log

I am on a shared platform and cannot change php.ini . However, the hosting platform allows me to set the memory_limit for php, which I have done - 756M. phpinfo() returns both master and local ...