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
183k 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 ...
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 ...
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): '...
21
votes
2answers
2k views

Magento 2: What's a “static view file”

If I use the module:enable or module:disable command to enable or disable a module, php bin/magento module:enable Pulsestorm_TutorialObjectManager1 php bin/magento module:enable ...
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 ...
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 ...
15
votes
3answers
1k views

Magento 2 Shortcut/GUI tool to perform commandline tasks for windows

I know, that the command line tool for magento 2 is very useful, but when in development,we need to perform some common tasks like clear the cache, deploy static content, upgrade db, enable extension ...
13
votes
5answers
12k views

Constant name is expected. Error

I am receiving this error: Uncaught exception 'InvalidArgumentException' with message 'Constant name is expected. While running php bin/magento setup:upgrade in command line. i got this http://...
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 ...
12
votes
3answers
6k views

magento 2 - In what case we need to run this command magento setup:di:compile?

In what case we need to run this command magento setup:di:compile ?
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 ...
11
votes
3answers
3k views

MAGE_DIRS bootstrap parameters in CLI

In pub/index.php, the following code is used to set change URLs for media and static assets to omit "/pub": $params[Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS] = [ DirectoryList::PUB => [...
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
3answers
1k views

Magento2 which command Run and when to Run

Kindly Clear Difference Between php bin/magento cache:flush and cache:clean and when they need to Run . which tasks Output to need cache:flush or clean ** and which task need these Commands => **di:...
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/...
7
votes
1answer
99 views

Magento module:uninstall orphans any dependencies (required modules)

I have some modules that are dependent on a core module. When I use the command composer require stti/module-catalogbook Magento installs 2 modules.. Stti_Catalogbook and Stti_Catalogcore. If i ...
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
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 [====>----------------...
6
votes
1answer
3k views

Magento 2 - How to run fast command line setup:di:compile?

How to run fast command line setup:di:compile. I was waiting so long, if can you show me why?
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/...
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 ...
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 ...
5
votes
1answer
2k views

Magento 2: How to display error message in CLI

I have an indexer, which needs to be configured first - requires API credentials. When I run in a reindex command in CLI: $ bin/magento indexer:reindex my_reindexer_name and the API credentials are ...
5
votes
3answers
2k views

After upgrade bin/magento not working

After upgrading my local instance of magento 2.1 to 2.1.2 the bin/magento tools stopped working. I do not get an error or any output. For instance when I run php bin/magento setup:upgrade after ...
5
votes
1answer
122 views

Is it possible to get the Magento indexer to display % complete?

Right now you are left wondering what is going on during indexing, especially on large catalogs where it takes hours to complete just one index. Is there an easy way to get the command line indexer....
5
votes
1answer
131 views

How to install extensions manually on Windows?

I can install extension manually using the 'mage' shell script on Linux - but is there an equivalent tool for Windows?
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/...
5
votes
1answer
165 views

Problem with CLI

Hello i have an error of every command i press in CLI. Following this Error Deprecated Functionality: The each() function is deprecated. This message will be suppressed on further calls in /var/...
4
votes
3answers
15k views

Please upgrade your database: Run “bin/magento setup:upgrade” from the Magento root directory

I created module magento 2,but module can't run and errors exist Please upgrade your database: Run "bin/magento setup:upgrade from the Magento root directory. " i tried to run command bin/magento ...
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 ...
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 ...
4
votes
6answers
5k views

Cronjob issues with APC

I used the following command to setup my cronjob: sudo crontab -e -u www-data and the actual cronjob: */5 * * * * /bin/sh /var/www/cron.sh >/dev/null 2>&1 I also have APC running on my ...
4
votes
1answer
4k views

Install Magento 2 on different mysql port

I have my nginx running on port 8080 and mysql running on port 3307. I want to install magento 2 cloned from git using CLI. Any idea how to configure the database which will use the port number 3307. ...
4
votes
2answers
2k views

Why my bin/magento setup:upgrade is really slow?

Running this command seems incredibly slow taking around half an hour+. I feel like it didn't always take this long and am wondering if this is normal and if not what can cause this? This is a very ...
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
4answers
4k views

Magento 2.0 Stable - Enabling Custom Module gives error

Download Today I downloaded the Magento 2.0 Full Release from the Magento website. I downloaded the Full Release with Sample Data (ZIP with sample data) and installed it. I wanted to test if my ...
4
votes
2answers
155 views

Why can't I access my custom cache key via CLI when it was set through a web request?

I have a method that calls the following code from a web request. Mage::app()->getCache()->save('bar', 'foo', array(), 60*5); I have another method that calls Mage::app()->getCache()->...
4
votes
1answer
621 views

Magento 2.2.5 After Upgrade To 2.3 CLI commands don't work

I upgraded magento version by documentation, after upgrade this happens: When running php bin/magento cache:flush or any other bin/magento command error appears There are no commands defined in the "...
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
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?
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 ...
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 ...
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 ...
3
votes
1answer
8k views

Magento 2 - bin/magento No commands working - Class 'Cli' not found Error

PHP Fatal error: Class 'Cli' not found in /home/xxx-xxx/public_html/bin/magento on line 31 xxx-xxx@rck:~/public_html$ php bin/magento No lock file found. Unable to read locked packages#0 /...
3
votes
3answers
2k views

Cant run commands in terminal magento 2

When try run command in terminal example php bin setup:upgrade show like these error messages. Not only that but also all commands -[ReflectionException] Class Magento\Config\Console\...
3
votes
2answers
2k views

Magento 2: Run commands in Docker

I am new to docker and devbox. I have setup DevBox Successfully and its working fine in a local system. I need information how to run CLI ie. php bin/magento cache:flush access phpmyadmin My local ...
3
votes
2answers
7k views

After upgrading to php 7 bin/magento CLI commands not working Magento 2.0.2 CE

I've upgraded the php version of the apache2.4 server from 5.6 to 7.0. OS version Ubuntu 14.04 LTS. After this update, despite the fact that I've installed php7.0-cli, when i try to run php7.0 bin/...
3
votes
4answers
6k views

getting error: Class Magento\Indexer\Model\ResourceModel\Indexer\State\CollectionFactory does not exist

When i run command for indexing php bin/magento indexer:info Error was thrown Class Magento\Indexer\Model\ResourceModel\Indexer\State\CollectionFactory does not exist [Magento\Framework\...
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?
3
votes
1answer
972 views

What does Mage_Catalog_Model_Product_Status::STATUS_DISABLED Do?

I wrote a script that searches for products with no active categories and disables the products. This was in regards to our customer turning off some old categories, but the products still being ...

1
2 3 4 5 6