All Questions

Tagged with
Filter by
Sorted by
Tagged with
1
vote
2answers
65 views

Magento 2 - Area code not set when running script via command line CLI

I have created module for exporting my product data to script outside of Magento2. This is my Data.php <?php namespace Oktarin\Nabavanet\Helper; class Data extends \Magento\Framework\App\Helper\...
2
votes
0answers
29 views

Fatal Error in Magento Command Line

Trying to do a module check from the command line gets me a Fatal Error. I'm using XAMPP to run Magento 2.3
0
votes
1answer
87 views

How to walk through a collection with pagination

I working on a command line which is fetching all the products in the database, using the Magento\Catalog\Model\ResourceModel\Product\CollectionFactory object. In order to avoid memory problems, I'm ...
1
vote
1answer
300 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 ...
5
votes
1answer
141 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/...
3
votes
2answers
139 views

Magento 2: Implementing module with cli

I'm trying to implement a banner slider without Commands I have already pasted the folder into public_html/app/code/ And I created a PHP file in public_html and tried to run it but nothing happens ...
2
votes
2answers
286 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
1answer
195 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 ...
1
vote
1answer
439 views

Can't run php bin/magento

Trying to set up a site from production (new to Magento and doing some fixes) and getting this error when running php bin/magento We're sorry, an error occurred. Try clearing the cache and code ...
3
votes
1answer
5k 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 /...
0
votes
1answer
14 views

Magento 2: How to optimize the execution of the CLI?

I run the command php bin/magento many times a day, so I'd like to know if I can optimize the execution of this one? For example: php bin/magento cache:flush
0
votes
1answer
714 views

Why do CLI commands return no errors/exceptions?

Problem: I'm writing a custom module, and everything is output just fine when there are no errors/exceptions. But as soon as I experience an error, nothing is displayed in the command line (using ...
3
votes
1answer
853 views

Console command waiting for input from user

It is possible in PHP to create console command waiting for an input from user like this or like this. Is there any 'magento-way' or above approaches can be used?
1
vote
0answers
62 views

n98-magerun doesn't throw errors?

I am working on a magerun command, but it seems that errors are not triggered. E.g. protected function execute(InputInterface $input, OutputInterface $output) { $this->detetMagento($output); } ...
1
vote
2answers
4k views

How to set the locale (en_US") of Magento2 (I/F Locale) by using command line

I have installed magento 2.0.7 with CentoOS 7 / Apache 2.4.6 / PHP 7 / MariaDB 10. After applying the Japanese locale to "Interface Locale" under Account Setting (refer the link below), I get "HTTP ...
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 ...
5
votes
1answer
116 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....