Downloads

Downloads

To download support materials, please select your product from the list below. You will automatically be shown all downloads for that product, including extensions, brochures, sales presenters and technotes.

  • 1. Select your section, category and chosen product.
  • 2. Click on the Manual, brochure, sales presenter or technote of your choice.
  • 3. Take careful note of any applicable instructions, especially for extensions.
  • 4. Download the file to your hard drive.
Knowledge Base

Knowledge Base

how to install composer?

Date Created: 23 May 2016
Last Updated: 27 Mar 2020

If you’re new to Composer or package managers like Node’s NPM then you’ve got a lot to take in before you start working with Magento 2. You see, Magento 2 is dependent on Composer and all of its package/dependency goodness.

It’s true that Magento and several other developers have written articles detailing what I’m about to go through, but I decided to write this for the absolute beginner with deeper explanation of what is going on throughout the steps – particularly the role of Composer.

STEP 1: SERVER ENVIRONMENT

Magento 2 has new minimum requirements of your LAMP stack. I’m not going to list them here in case they change so please check the Magento 2 documentation for those prerequisites. A Vargrant setup is preferable but MAMP Pro can also work.

STEP 2: COMPOSER

If you’re unaware of what composer is then try this analogy. Composer is exactly like…. a composer. In this case Magento 2 is a musical and the packages installed are the members of the orchestra. Once installed in your project, Composer can be used to manage packages based on its dependency system. You can’t have a live musical without the orchestra and you can’t have Magento 2 without its packages. In both cases the composer is responsible for assembling components to allow the rest to work.

Fire up your command line tool and navigate to an empty folder where you’d like to install your copy of Magento 2. We need to ensure Composer is installed globally on your system so that you don’t have to repeat this step again.

Type the following command to see if composer is installed:

1
composer -help

If it’s not installed you’ll see the response command not found, which means you need to install Composer. Luckily it’s as simple as running the following two commands:

1
2
mv composer.phar /usr/local/bin/composer

The first command installs Composer into your local directory, the second will move the composer.phar file to a directory where it can be accessed globally by your system.

If you run the original command again you should see that Composer is installed and ready:

 

STEP 3: CLONE MAGENTO 2

To clone Magento CE 2 into your current directory run the Git following command:

It will clone the repo into a magento2 subdirectory, and this should take about 2-3 minutes depending on your broadband speed. Once it’s done run the following command to move into the Magento 2 root directory and checkout the master branch.

1
2
cd magento2
git checkout master

In order to work with Composer a project must have a composer.json file within its root directory. If you take a look at the file you’ll see a huge list of Magento 2 package dependencies. I’ve picked out first three

Support Enquiry

Support Enquiry

If you have a question or require technical support for a Magespacex hosting or extensions you have purchased, please fill out the form below and a member of our support team will contact you shortly.

  • * Required Fields

Warranty