comment 0
/ wsakaren

Starting out with Magento 2

So you are a Magento 1.x developer and you haven’t even looked at Magento 2.  You are busy, you just need to get this thing up and running. How do you do this?

So we all hate reading docs. Here is the quick setup for installing Magento2. If you want the long route – http://devdocs.magento.com/

Pre-Requisites

I’m assuming you have composer, PHP 5.4+ and MySQL5.6+. If you have MAMP installed time to go sort that as it wont work (MAMP is on MySQL5.5.x). Personally I use MacPorts and just updated everything thro this. I know i’m meant to run up docker, vagrant and everything else but for what I need MacPorts is fine (and fast!).

You also need Composer.

  • Install Composer – curl -sS https://getcomposer.org/installer | php
  • mv composer.phar /usr/local/bin/composer (might need to sudo)

Install Magento 2 via GitHub & Browser

This  looks at how you install via the Github clone route

  1. Goto base httpdocs directory
  2. git clone git@github.com:magento/magento2.git
  3. Set permissions (like you do in Magento 1.x)
  4. cd magento2
  5. composer install
  6. Create a blank DB
  7. Edit setup/index.php and add this – ini_set(‘xdebug.max_nesting_level’, 200);
  8. Navigate to magento install in browser and kick off the wizard
  9. Hurrah

Install Magento via Command Line

Personally I prefer to install via the command line, its just quicker.

  1. cd htdocs
  2. composer create-project magento/community-edition magento2 <tag> –prefer-dist
  3. create db (see details below)
  4. Edit setup/index.php && index.php and add this – ini_set(‘xdebug.max_nesting_level’, 200);

Magento versions can be obtained via their github page.

Then run the following (changing fields where appropriate)

bin/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=Magento --admin-lastname=User --admin-email=user@example.com \
 --admin-user=admin --admin-password=admin123 --language=en_US \
 --currency=USD --timezone=America/Chicago --use-sample-data --use-rewrites=1

bin/magento is your key to a lot of things, so best get used to it!

Leave a Reply

Your email address will not be published. Required fields are marked *