cancel
Showing results for 
Search instead for 
Did you mean: 

Error: Too many arguments, expected arguments command

Highlighted

Error: Too many arguments, expected arguments command

Hello,

I'm new to Magento and this is the first time trying to setup a test shop.

For this purpose I use a Ubunto 16.04 Image (Apache 2.4, PHP 7.0.25, MySQL 5.7.21) running on AWS.

I think, I did everything about prerequisites and pre-Installation Tasks very carefully.

Now I am at the Point of installing Magento 2.2.2.

I want to do this with the command line.

This is the command I use:

 

php magento setup:install --base-url="http://127.0.0.1/magento2/" --db-host="localhost" --db-name="magento" --db-user="magento" --db-password="magento" --admin-firstname="martin" –-admin-lastname="kaltenboeck" –-admin-user="admin" --admin-password="martin99" --admin-email="office@km-tools.at" -–language="de_AT" --currency="EUR" --timezone="Europe/Vienna" --cleanup-database --session-save="db" --use-rewrites="1"

 I get the following error message:

[Symfony\Component\Console\Exception\RuntimeException]
  Too many arguments, expected arguments "command".

I tried to enter the command as one line in the bash Shell.

 

I tried to put the command into a .sh-file and execute it with sh commandfile.sh

I tried to insert line breaks (backslash) to put every Argument in one line

I tried to use single, double and not quotes.

 

None of that works.

 

I found only a few Posts on the net dealing with that Problem, but could not find a solution over days.

 

Any help is appreciated! - Thanks in advance.

 

Regards,

Martin

11 REPLIES 11
Highlighted

Re: Error: Too many arguments, expected arguments command

Hi @martin_kaltenböck,

 

Can you see somehitng if you run this command?

 

php bin/magento --version

(You must be at the root directory of your store)

Highlighted

Re: Error: Too many arguments, expected arguments command

Thank your for the answer.

 

Yes, that works!

 

Tried some easy commands like

 

php magento --version

php magento list

php magento info:language:list

 

They all work!

 

I used to start the commands directly from the <installdir>/bin directory.

I now also tried to start it from <installdir> with php bin/magento <command> as you posted, but it makes no difference.

 

So what else could I try?

Highlighted

Re: Error: Too many arguments, expected arguments command

Have you tried running it from your browser? And does that result with the same error?

If this response was helpful to you, consider giving kudos to this post.
If this response solved your problem, click accept as solution to help others solve this

Re: Error: Too many arguments, expected arguments command

Sorry, I'm not sure how to enter magento commands in a browser.

Do you mean something like this:

 

http://<myserver>/magento2/bin/magento?list

 

In this case the browser Shows:

#!/usr/bin/env php getMessage(); exit(1); } try { $handler = new \Magento\Framework\App\ErrorHandler(); set_error_handler([$handler, 'handler']); $application = new Magento\Framework\Console\Cli('Magento CLI'); $application->run(); } catch (\Exception $e) { while ($e) { echo $e->getMessage(); echo $e->getTraceAsString(); echo "\n\n"; $e = $e->getPrevious(); } exit(Magento\Framework\Console\Cli::RETURN_FAILURE); }

BR, Martin

 

Highlighted

Re: Error: Too many arguments, expected arguments command

I have the totally same problem

anything update?

Highlighted

Re: Error: Too many arguments, expected arguments command

Got many errors with magento 2 installation then just run out of space on server disk.

One more think is I have to use full path to magento 2 bin folder (magento 2.2),

 

that means for example something like

php /home/storename/storename.domain/html/bin/magento setup:di:compile 

instead being in folder and calling

php bin/magento setup:di:compile

 


Professional magento ecommerce development - http://electroid-lab.com
Highlighted

Re: Error: Too many arguments, expected arguments command

I am experiencing the same problem. I can run basic commands without problem. When I try a browser installation all my file permission checks fail even though I have granted full rwx access to all of the relevant folders. So I am trying the command line install for Magento2.2.5.

 

How did you overcome the error???

[Symfony\Component\Console\Exception\RuntimeException] 

  Too many arguments, expected arguments "command".

Thanks.

Highlighted

Re: Error: Too many arguments, expected arguments command

–-admin-lastname is --admin-lastname, also -–language.

you should check others Smiley LOL, i had this error in chinese char yestoday Smiley LOL.

Highlighted

Re: Error: Too many arguments, expected arguments command

I found that running the command to set up cron produced this error.  I ran the command from the /bin/ directory where the magento file is, and I removed the [--force] parameter, as I was setting up the initial cron file.  This succeeded.