Magento 2 – Fix Too Many Arguments for Install Using Command Line

command lineinstallationmagento2

I'm trying to install Magento 2 on Debian-system from the command line.

And by running:

php magento setup:install --base-url="http://localhost/magento2" 
--db-host="localhost" --db-name="magento2_db" --db-user="magento2_user" 
--db-password="*password" --admin-user="admin" 
--admin-password="*password" admin-firstname="admin" 
--admin-lastname="user" --use-sample-data --cleanup-database

I'm getting only:

[RuntimeException]
Too many arguments.

viewed that question Magento 2 command line install (too many arguments) too, but cant help me further…

Best Answer

Add -- before admin-firstname to resolve the issue.

like

php magento setup:install --base-url="http://localhost/magento2" 
--db-host="localhost" --db-name="magento2_db" --db-user="magento2_user" 
--db-password="*password" --admin-user="admin" 
--admin-password="*password" --admin-firstname="admin" 
--admin-lastname="user" --use-sample-data --cleanup-database