5

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 setup:install --admin-user="user"

or a variation with [--admin-user="user"]

I get

[RuntimeException] Too many arguments.

enter image description here

What am I doing wrong? I would like to put that line in my script, so I can install Magento with user defined variables

I am using Magento 2.0.2 with Sample Data on Ubuntu 15.02

1
  • 2
    I recently wrote a simple bash script for setting up Magento 2 that creates an instance from a GitHub repo, sets up an Nginx config and installs the software based on user input. You may be interested in it github.com/affinitycloud/magesetup Commented Feb 21, 2016 at 19:38

5 Answers 5

4

I think you have forgot about the -- in front of the command. (So it seems in your screenshot).

1
  • Stupid me, the command works now! thanks!!!
    – Maarten
    Commented Feb 18, 2016 at 13:55
2

I had a similar issue and the correct installation command is:

php bin/magento setup:install 
--base-url="http://example.co.uk/" 
--db-host="localhost" 
--db-name="databasename" 
--db-user="databaseuser" 
--db-password="databasepass" 
--admin-firstname="Yourname" 
--admin-lastname="Yourname" 
--admin-email="[email protected]" 
--admin-user="admin" 
--admin-password="setpasswordhere" 
--language="en_GB" 
--currency="GBP" 
--timezone="Europe/London" 
--use-rewrites="1" 
--backend-frontname="admin"

Install Magento 2 using CLI

As mentioned, in your case command line options for the Magento 2 CLI installer require -- before the option name (e.g --base-url="example.com")

1
  • in wamp its working fine for magento2.3 and php7.2.4. make sure its in single line.
    – MageLerner
    Commented Nov 29, 2018 at 7:08
1

Please remove the double brackets and run the following command.

bin/magento setup:install --backend-frontname="adminlogin" \
--key="biY8vdWx4w8KV5Q59380Fejy36l6ssUb" \
--db-host="localhost" \
--db-name="magentodb" \
--db-user="root" \
--db-password="secretpassword" \
--language="en_US" \
--currency="GBP" \
--timezone="Europe/London" \
--use-rewrites=1 \
--use-secure=0 \
--base-url="http://www.newmagento.com" \
--base-url-secure="https://www.newmagento.com" \
--admin-user=adminuser \
--admin-password=admin123@ \
[email protected] \
--admin-firstname=admin \
--admin-lastname=user \
--cleanup-database
0

create a new file name it install.sh , use a text editor to paste that command , save it. chmod +x install.sh and do ./install.sh

0

You can use proper command line

php bin/magento setup:install --base-url="http://localhost/sport/" --db-host="localhost" --db-name="sports" --db-user="root" --admin-firstname="admin" --admin-lastname="admin" --admin-email="[email protected]" --admin-user="admin" --admin-password="admin123" --language="en_US" --currency="USD" --timezone="America/Chicago" --use-rewrites="1" --backend-frontname="admin"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.