Questions tagged [cli]

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

Filter by
Sorted by
Tagged with
25 votes
7 answers
17k 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): '...
5 votes
3 answers
8k 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/...
0 votes
2 answers
2k 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?
1 vote
3 answers
275 views

Magento 2 - Syntax error on bin/magento support:backup:db

I am trying to get backup of DB using following command php -dmemory_limit=1G bin/magento support:backup:db It is giving me syntax error: sh: 2: Syntax error: word unexpected (expecting ")") Error: ...
2 votes
1 answer
1k views

static files deleted after php bin/magento setup:upgrade

While setting up new module and after running php bin/magento setup:upgrade it started to clean cache and file and deleted all front end css and adminhtml css and all visual files. How Can I prevent ...
2 votes
3 answers
2k views

Programmatically installing a module

I need to install modules so that the database changes happen. I can't just let it be an install on logging to admin type of approach as I have a bash script that I am using to provision my test ...
3 votes
3 answers
13k views

Magento 2: How to solve an error when reindex by CLI?

I used Magento 2 stable version. when I run Magento setup:upgrade, following error occurred. [InvalidArgumentException] There are no commands defined in the "setup" namespace. And when I run Magento ...
2 votes
1 answer
2k views

remove 'pub/' folder for URLs from command line

For increased security, we configured the DocumentRoot for our Magento application to be in the pub/ directory of the Magento installation, as described in the official documentation. However, there ...
0 votes
0 answers
31 views

Magento: 500 Internal Server Error after upgrading to 2.4.4

The store front shows 500 Internal server error after I followed all instructions in the article here to upgrade Magento. On checking the version of Magento with the command bin/magento --version ...
0 votes
0 answers
23 views

Apply .htaccess rule for controller and cron

I have some long-running scripts that should bypass the "Connection Timeout" set up in LiteSpeed. I want to do it in the .htaccess file and it works if I apply this rule (*RewriteRule . - [E=...
0 votes
1 answer
1k 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" ...
3 votes
2 answers
1k 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
2 answers
1k views

segmentation fault while reindexing catalogsearch_fulltext in magento2

I am trying to reindex all indexes using CLI which results segmetation fault. I am using magento2 version 2.0.8 and previously using 2.0.7 but later updated to 2.0.8. I am getting error in both ...
1 vote
1 answer
26 views

List of All Magento 2 Configuration Files

Magento 2 uses XML-based configuration files A LOT. When studying Magento or preparing for an exam, it is useful to have a list of all config files used in Magento 2. How can such a list be generated? ...
0 votes
0 answers
12 views

magento 2.4 button calls cli command class

I've created a custom console command using standard magento code: namespace Vendor\Module\Console\Command; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\...
1 vote
3 answers
783 views

Command line user does not have read and write permissions on generated directory. Please address this issue before using Magento command line

My Magento site is down and I see main.CRITICAL: Cannot write to the "/var/www/html/var/debug/db.log" file. Unable to write {"exception":"[object] (Magento\Framework\Exception\...
0 votes
2 answers
12k views

"Could not open input file" error while running php command in windows

I have installed Magento 2.2.5 on my localhost windows system. I use the wamp server. I am unable to run any PHP command and getting the error Could not open input file: C:\wamp64\www\magento2 I got ...
20 votes
6 answers
20k 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 ...
1 vote
2 answers
2k views

Removing modules from vendor magento 2.3

I'm trying to remove a few modules located inside the vendor folder. If i remove them manually it throws an error on the frontend. Warning: require(/srv/public_html/vendor/composer/../amzn/amazon-pay-...
6 votes
3 answers
7k 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 ...
3 votes
2 answers
1k views

why my magento 2 localhost setup in very slow?

When i run cli cmds it's take to much time >php bin/magento s:s:d -f frontend/Magento/luma/en_US 2918/2918 ===100% % 10 mins frontend/Solwin/kosmic_child/...
0 votes
1 answer
102 views

CLI command without option name

I know how to create custom CLI commands with input parameters like: bin/magento customers:syncbyid --id=69, but I'd like to know how (if even possible) I can create a command with an option without a ...
15 votes
6 answers
18k 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://...
2 votes
1 answer
1k views

Magento 2 static deploy en_US argument invalid on XAMPP

I've cloned a working magento 2 repo, done composer install and when I'm trying do do: setup:static-content:deploy I get the error: [InvalidArgumentException] en_US argument has invalid value, please ...
4 votes
6 answers
16k views

How to remove captcha in via terminal?

I want to remove the captcha and its input field from the forgot password form and admin. Please help me to remove that.
0 votes
3 answers
31 views

Proper etiquette when enabling/disabling extensions in production mode?

What is the proper protocol for enabling a custom built extension during production mode? When I run php bin/magento setup:upgrade I get the following error: The directory "/chroot/home/af3d0522/...
88 votes
13 answers
197k 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 ...
1 vote
2 answers
2k views

Catalog Search indexer process unknown error

I'm getting a 'One or more indexers are invalid. Make sure your Magento cron job is running.' and it seems I need to run php bin/magento indexer:reindex from the CLI. I get the index rebuilt ...
3 votes
2 answers
1k views

Check if all module dependencies are met

I recently disabled some modules and after an upgrade I feel that new dependencies got introduced (when disabling and re-enabling a custom module I got errors). Is there a command to check if the ...
1 vote
5 answers
4k views

How to install Magento 2.4

I try install fresh magento 2.4 but always available setup wizard but currently I not see setup wizard in this version. https://prnt.sc/u8eeoi How to install magento 2.4 ?
0 votes
1 answer
59 views

how can i run setup:upgrade and cli commands on windows

Hello everyone in my case i have installed Magento 2.3.4 on Windows and i need to run setup:upgrade like on Ubuntu , but it's not working for me , is this issue because on Windows we have backslash '' ...
14 votes
15 answers
30k 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 ...
0 votes
0 answers
53 views

How to remove thousands of fake customer accounts?

I'm trying to remove all fake customer accounts, but first I need to unsubscribe them from my newsletter, I have around 600k fake accounts to remove, trying to run it via admin massive action I got ...
0 votes
1 answer
24 views

magento2 add address to customer via cli

Using Create new customer using CLI like admin approved method as a base I have been pulling my hair out on how to extend it so I can also add an address to the created user via CLI. any assistance is ...
0 votes
1 answer
26 views

Admin input value is not accessible after adding the order increment ID while executing the command

I created a custom CLI command where I have to delete the order Items using the Order Increment ID, Item SKU. I used the ask() method after executing the command php bin/magento webkul:orderDelete ...
0 votes
0 answers
79 views

magento 2 run comand and error showing it

when I have run upgrade command or run deploy command and below type error coming it php -dmemory_limit=5G bin/magento setup:upgrade Error: Path "." cannot be used with directory "...
0 votes
1 answer
27 views

Problem with multiple themes deploy in Magento 2

When I execute CLI command: php bin/magento setup:static-content:deploy. It always has only 4 steps themes, but now I have multiple duplicate themes while running the command. frontend/Magento/blank/...
1 vote
2 answers
325 views

Magento 2 how to set proper file and folder permission in localhost ubuntu 18?

i'm using magento 2 in local setup in ubuntu 18 when every time i run cmds php bin/magento s:s:d -f php bin/magento s:up php bin/magento s:d:c the file permission changed how to give proper ...
0 votes
0 answers
18 views

How to fire multiple page requests on server at the same time for a Magento 2 website

Can anyone please suggest to me how can I fire multiple page requests approx 50,000+ requests/second at the same time on a Magento 2 website to check for the server storage and request handler? Is ...
0 votes
0 answers
62 views

error:14090086: Installing Magento Cloud CLI

Trying to install Magento Cloud CLI in my user home, I got the next error: -This is the second time. I tried to curl the installer as manual says. Successfully I've been installed MGC CLI in an ...
0 votes
0 answers
23 views

Magento Cron Job is Running a Command It Shouldn't Be?

We have four CLI commands: submit, receive, cancel and import. The first three: submit receive and cancel are all set up to run via the cron job. However, I keep seeing in the logs that the import ...
0 votes
2 answers
69 views

Magento 2 custom CLI file thrown error when call function from block?

What I do wrong in my cli command file? thrown error when try to clean cache like this "There are no commands defined in the "cache" namespace." class Hicustomer extends Command ...
0 votes
1 answer
143 views

how to call function from cli command magento 2

How can call function from block to cli command magento 2 here is my cli command class class Hicustomer extends Command { protected function configure() { $this->setName('...
2 votes
0 answers
339 views

Magento 2.3 -> 2.4: CLI commands all throw "Area code is not set"

The story so far: I'm updating Magento from 2.3 to 2.4 and in doing so I'm now getting an "Area code is not set" when running any CLI command. This did not happen in 2.3 and after looking at ...
0 votes
1 answer
236 views

Magento Cloud CLI cURL error 60: SSL certificate problem: certificate has expired

I am working on macOS Big Sure 11.6 and since Friday(01.10.) I face an issue with my Magento Cloud CLI. I was working without problems and out of a sudden, this error occurred. Has anybody faced ...
0 votes
1 answer
22 views

Programatically mass change product prices

I am writing a module that uses a cli command get a csv file and use that to change the prices of a selection of products based on sku and new price retrieved from an CSV file. I have the logic for ...
0 votes
1 answer
30 views

Magento or Apache 2 Permission?

I have a vm where I run ubuntu 18.04 , Apache 2 and Magento 2.3 every thing works fine but I think I'm doing something wrong with my permissions. So I have added to user 'dev' to the www-data group (...
0 votes
1 answer
149 views

Issues connecting Magento Cloud to Bitbucket

Following the Bitbucket integration guide, I provided all the required permission to the Auth Consumer, and I log out and log in again with my Magento Cloud CLI, but even though I keep having this ...
0 votes
0 answers
18 views

Auto configure custom widget programmatically after enabling it in Magento 2

I'm struggling with some concept of auto-configuration custom widget provided by the module. By default, the widget should be configured by the merchant, which is obvious, but my question is - is ...
0 votes
1 answer
26 views

Magento 2.3.5 - Could we configure our installed module fields via Magento 2 CLI?

Could we actually configure our installed module fields via Magento 2 CLI? For example: # typical way to enable a Magento 2 module, via Magento 2 CLI bin/magento module:enable Acme_Acme # can we do ...

1
2 3 4 5 6