Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [command-line]

Denotes questions related to command line.

32
votes
5answers
15k views

Why can't one switch back to the default mode on Magento 2?

So I have switched to the developer mode while developing on a Magento 2 project using the following command: php bin/magento deploy:mode:set developer All good, I got this message and I developed ...
18
votes
5answers
17k views

Magento 2: What is difference between Cache Clean & Cache Flush?

In Magento 2 we have 2 commands php bin/magento cache:flush php bin/magento cache:clean What's the exact difference between them? I'm generally using cache:flush. I never used cache:clean. So, ...
16
votes
4answers
34k views

How to reindex Magento by using command line

How can I reindex magento using by command line. Kindly provide steps for the same.
15
votes
6answers
4k views

Magento 2: When should I run which commands?

I have been working with Magento 2 for 2 months now. I realized that I am using bin/magento setup:upgrade way too much. I think I do not know when I have to run that command. Here are the situations ...
11
votes
2answers
2k views

Magento2 - Command-Line - Sending Email Using Block Templates - Error: Missing required argument $debugHintsPath

When attempting to send emails in Magento 2 from command-line, I encountered the exception below. While using the very same class to send emails from an frontend or backend controller was working ...
11
votes
3answers
4k views

magento 2: 'i18n:collect-phrases' command creates different csv files

php bin\magento i18n:collect-phrases -o "C:\xampp\htdocs\magento\app\design\i18n\xx_YY.csv" -m collects all phrases in the magento application and outputs a csv file with 4 columns: php bin\magento ...
8
votes
2answers
6k views

How to debug Magento 2 code when using command lines?

Running a script in command line is something we frequently do in Magento 2. For example, when creating new module, we must run setup:upgrade command. We cannot see all the information we need to know....
8
votes
5answers
3k views

Changes to CSS and JavaScript applies only after deploying static content

I installed Magento 2 from the Magento site. I have activated the developer mode by {project directory}>php bin/magento setup:mode:set developer Then I have installed my custom theme and finally ...
6
votes
1answer
1k views

How to get list of all routes in Magento 2?

Is it possible to get the list of all routes in a Magento 2 environment? I am looking some command-line tool, if there is any? Note: I had a bin/rails routes command to list all the routes in rails ...
5
votes
2answers
4k views

How to install module magento 2 don't need run command line bin/magento setup:upgrade

I need to install module pf magento 2 in hosting. I'm trying to connect host with port 21 using putty but not success. I need one other way, please help me.
5
votes
5answers
5k views

Magento 2 var/di folder is missing

There is no di folder generated in var directory. I am getting please re-run compile command. Why we need this di directory?
5
votes
2answers
651 views

Commands are not working even when I tried to give permissions

I am trying to run commands through ssh, but commands are not working. Please check the screenshot.
5
votes
2answers
2k views

Command line error stock magento

I get this error after install when trying to clear var/ generation, and static content deploy via command line. [Exception] Warning: Invalid argument supplied for foreach() in /vendor/magento/...
5
votes
3answers
6k views

Magento 2 command line install (too many arguments)

so I am trying to make a bash script in Magento, and I am learning from the bottom up. So I have the basic arguments ready to be used in the script I am making, but when I execute sudo php magento ...
5
votes
1answer
109 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
582 views

Magento 2 Terminal Progress bar while uploading csv file from terminal

I want to develop progress bar in a terminal because when I import CSV file its started to import but user has no idea how many records have been imported indicator will be like when we hit php bin/...
5
votes
2answers
1k views

Magento 2: Nginx pub/static not autogenerating, only works with command line static-content:deploy

I have tried many of the solutions from: Local installation of Magento 2 doest not generate files in the pub/static folder and similar posts: I am in developer mode (verified in command line, and I ...
5
votes
1answer
126 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
2answers
446 views

Difference between php bin/magento and bin/magento

In Magento when we run any command we use 'php bin/magento' and sometimes it runs also with 'bin/magento' So can any one explain what is the actual difference in these commands.
4
votes
2answers
2k views

How to inject Magento 2 commands in custom command?

To whom may concern, As the title said, I'm wondering is there anyway to inject/call/execute Magento default commands in my custom command? I'm just another guy who living in Terminal world and I'm ...
4
votes
1answer
1k views

problem with composer on magento 2

I want to setup new extension with composer on magento2 and I get this error: [Composer\Downloader\TransportException] Invalid credentials for 'https://repo.magento.com/packages.json', aborting. I ...
4
votes
1answer
2k views

How can i run system->import/export->export by Command ssh

I get no valid data send error during product export via system->import/export->export. Actually this because of time out error. How can run this export by command ssh.
3
votes
5answers
2k views

enable multiple modules for same namespace

I am installing a few modules one by one into my magento 2 application. Can we enable all modules in the same namespace with one command? Right now I am using: php bin/magento module:enable ...
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
2answers
2k views

Magento 2 di:compile command gives fatal error

I have taken reference of an old module (Bannerslider) created for Magento 2 Beta version and I am trying to convert it to Magento 2 stable compatible (Mycompany_Bannerslider). When I enable the ...
3
votes
1answer
900 views

Magento 1.9.3 Command Line Not Available

I have a quick question regarding the command line tool seen in Magento 2. I've been using it and it's amazing cool. However now I'm working on an older version of Magento 1.9.3 and I see there isn't ...
3
votes
1answer
790 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?
3
votes
3answers
9k views

Magento 2 - setup:install & setup:upgrade

I have updated the code in my custom module and run setup:install already. Do I still need to run setup:upgrade?
3
votes
1answer
885 views

Installing Magento2 Data-Migration-Tool manual without composer

How can I install the magento2 data-migration-tool manual without composer? Already I copied the complete "data-migration-tool"-folder in vendor/magento. When I try to use migrate commands (ex. "...
3
votes
3answers
3k views

Set magento deployment mode to production fails

I've installed a new Magento 2 installation with Softaculous on my hostingserver. After installation I would change the default deployment mode to production but I have the following error (using SSH):...
3
votes
1answer
801 views

'php magento setup:di:compile' generated cache file with wrong user groups

Suppose user-a run the command php magento setup:di:compile, it generated cache file with wrong user group, the wrong user group is user-a(the primary group of user-a), in fact it should be apache(the ...
2
votes
2answers
2k views

Is it possible to get a direct link to the TAR package file of the latest release of an extension?

Everytime I need to download a Magento package, I need to do so via the Connect Marketplace and I then have to copy the URL (key) from there. For example, to download the "Log Viewer" extension, I ...
2
votes
1answer
4k 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 /...
2
votes
2answers
290 views

Using Command Lines Magento 2

Dear Magento specialists, I always had Magento 1 running. However for my new webshop I like to run Magento 2. I have installed Magento 2 using Installatron. I extracted theme files in the root ...
2
votes
2answers
99 views

My live site page has unaligned

It's urgent my live site website has unaligned after running; "sudo bin/magento-cli setup:static-content:deploy" command. All page alignment has changed. Please help to fix this solution. Please ...
2
votes
1answer
531 views

Magento 2 Custom command Area Code note set exception

I have created a command for my module which calls a class Model/Importer from https://github.com/firegento/FireGento_FastSimpleImport2 extension. but i think it requires admin session. I have tried ...
2
votes
2answers
107 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/...
2
votes
2answers
251 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 ...
2
votes
2answers
2k views

Magento 2 auto install shell script

I am wondering is it possible to install Magento 2 with a shell script? Like we run shell script and Magento 2 will be installed automatically? Just like softaculous on cpanel ? Any help will be ...
2
votes
2answers
617 views

What are basic steps for installing a third party theme in Magento 2?

[ Asking for the proper sequence and the basic steps ] Hello, I am beginner to Magento 2, and its folder structure. I am trying to install a theme in M2, and has finally installed. But to achieved ...
2
votes
0answers
21 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
2
votes
2answers
205 views

“Area code not set” error. Still getting this error after a lot of search?

First of all, I have to tell you that I have spent a lot of time researching and I have done all the solutions I have came across but I'm still getting this error when I run setup:di:compile The full ...
2
votes
1answer
43 views

All necessary commands for Using Magento 2 - For beginner

ALL Basic Commands I am new in Magento 2 but require I necessary commands including bash commands and git command to working with Linux based system ,
2
votes
1answer
259 views

Notice: Undefined index: modules in ../Converter.php line 47 - Magento 2 - (Solved)

Hi i am getting error in magento 2 frontend after creating my custom module.(Here mmm2 is my magento directory) a:4:{i:0;s:134:"Notice: Undefined index: modules in /home/vhost/_default/mmm2/lib/...
2
votes
0answers
166 views

magento setup:upgrade enables module

I've just created a Magento2 module, here is the module.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:...
2
votes
0answers
48 views

Deploy Sample Data Content to app/code folder instead of vendor

I can deploy sample data to vendor folder with with the command bin/magento sampledata:deploy in Magento 2 however I want to edit this command to deploy sample data to app/code/magento folder instead ...
2
votes
0answers
394 views

Magento2 - Change product status programatically depending on View

I'm working in a command script to import products to a Magento2 Store. I have more than 10(1 per language) Views for the same Website/Store. I don't have any problem when a product has to be in all ...
2
votes
1answer
690 views

Reindex command line for specific store view

I'm wondering is there any way to re-index the "Catalog Url Rewrites" of a specific store view in Magento with Multiple Stores. Is it possible to have store Id in indexer.php command-line?
2
votes
3answers
1k views

Missing commands for Magento command line

Whenever I run the common commands I get this and similarly named errors: [Symfony\Component\Console\Exception\CommandNotFoundException] There are no commands defined in the "deploy:mode" ...
1
vote
2answers
3k views

Magento 2 How to Create a Custom Console Command

Is it possible to create a new Magento command for example to delete the generation folder?