Schogini is Magento2 ready. Are you?

Get started with Magento 2 | Need expert Magento2 support?

Magento 2 Alpha Installation Steps. It Finally Works!

Posted on March 28, 2015 at 4:15 PM by Schogini

After a lot of trial and error, I managed to install Magento 2 at last - and it works! I am on OS X Yosemite 10.10.2. Magento 2, is next generation Magento - a cutting edge, feature-rich eCommerce solution that gets results.

Environment Setup

Lets jump right into it and start with getting the environment ready.

1. Check your PHP version and ensure mcrypt is enabled.

You must have PHP version 5.5.x or above.

  • To upgrade PHP use:
  • To ensure you have mcrypt enabled follow these steps:
    And then, these steps:
    brew link --overwrite autoconf brew link mhash brew install php56-mcrypt brew link --overwrite mcrypt brew install php56-mcrypt sudo apachectl restart
  • If, you are using XAMPP or MAMP then, do remember to:

    • upgrade your PHP to the latest version possible.
    • add the path to your XAMPP's or MAMP's PHP & MySQL commands to the evnironment variable.
      For example, to include PHP your .bash_profile should have a line like this. Similarly, find the path to your MySQL and include that too.

      export PATH=/Applications/MAMP/bin/php/php5.5.10/bin:$PATH

    2. Register for a GitHub account.

    You will need to generate a token in GitHub and use it while installing Magento 2. So, ensure you have already registered for a GitHub account

    3. Find your webserver's user.

    This is very important. All the installation steps that you follow from now on will assume that you are logged into the terminal as the webserver user. To find your webserver's user open your httpd.conf file and search for a section like this:

    <IfModule unixd_module> .... .... User _www Group _www .... .... </IfModule>

    In this example, the webserver's user is _www

    4. Set unlimited PHP memory limit.

    The Magento 2 installation processes take long and are memory intensive. Remember, to set the memory_limit to -1 in your php.ini. Remember, after any change in php.ini you must restart your Apache server. Many people tend to forget the restart step

    5. Set AllowOverride to All in your httpd.conf

    Search for your webservers directory section and change AllowOverride None to AllowOverride All. On my system it looks like this:

    <Directory "/Applications/XAMPP/xamppfiles/htdocs"> AllowOverride All ... ... </Directory>

    Whew! Ok, with all that in check lets start the actual installation process. (And the fun begins...)

    Installation Steps

    Magento 2 installation isn't as straight forward as just downloading, unzip, installation wizard. The steps below are generally the same as what is listed in the official Magento Installation Overview - though I have made some changes and tweaks for it to actually work!

    1. Install Composer

    Do confirm that you do not have composer already installed by trying out a command like composer --help. If, you get an output it means you already have composer and can skip this step - Yay!

    If not, then do these:

    cd /usr/bin/ mkdir composer cd composer curl -sS | php cp composer.phar /usr/local/bin/composer

    2. Clone the Magento repository

    I used the SSH method but, you can definitely opt to use the HTTPS method. Both the methods are described at this URL:

    I followed these steps:
    IMPORTANT: Ensure that you are logged in as your webserver's user

    1. Browse Magento GitHub and copy the repository clone URL
    2. We will clone the project into your WebServers's root:
      cd [your document root]
      For example, for Ubuntu, it’s /var/www, for CentOS it’s /var/www/html, for XAMPP or MAMP /Application/xamppfiles/htdocs
    3. git clone <the clone URL you copied before>
      I executed this: git clone
      It will take some time for it to copy the repository to your directory - it took around 10 mins for me.
    4. Ensure that all folders are owned by the webserver user & files are writeable only by the webserver user.
      Only the webserver user should have write permission in a folder.

      cd magento2 find ./ -type d -print0 | xargs -0 chmod 700 find ./ -type f -print0 | xargs -0 chmod 600

    3. Update Magento Dependencies

    Magento 2 uses composer to resolve all dependencies. Before you do this you MUST ENSURE that you are logged in as a webserver user. If not, this execute this command to switch users su

    1. Generate the GitHub Token

      Follow the steps at this URL to generate a GitHub key (remember, you should already have a GitHub account at this step) and connect it to your composer.

      This what I did:

      • Generate the token as per the URL
      • Execute: composer config --global <token>
    2. Update Magento Dependencies

      cd magento2 composer install

      This command updates package dependencies and will take a few minutes to complete.

    4. Decide whether you want to load sample data on your Magento shop or not.

    If, you decide to load your shop with sample data then, you have 2 options (I had to follow a combination of option #1 & #2):

    1. Enable sample data before installation
    2. Enable sample data after installation

    Option #1: Enable sample data before installation

    1. Decide the version of the sample data you want to install.

      When I installed Magento 2 the latest version was 0.42.0-beta11
      This URL has the complete list of sample data versions:
      Generally, the sample data's version will match the version of Magento 2 you downloaded.

    2. Do these:
      1. cd magento2
      2. cp composer.json composer.json.bak
      3. Open composer.json and add "minimum-stability": "beta", before "version" like this:

        "name": "magento/project-community-edition", "description": "Magento project (Community Edition)", "type": "project", "minimum-stability": "beta", "version": "0.42.0-beta10", "license": [ "OSL-3.0", "AFL-3.0" ],

      4. Save your changes to composer.json and exit the text editor.
      5. Execute this:

        composer config repositories.magento composer composer require magento/sample-data:<version>

      6. Wait while dependencies are installed - it took 5 mins on my system.

    5. Install Magento 2

    At last we have reached the step where you start the installation. You have 2 options here:

    • Install the Magento software using the command line
    • Setup Wizard installation

    I choose the Seup Wizard Installation and here are the steps I followed:

    1. Reset the folder and file permissions so that you can browse the files:

      cd magento2 find ./ -type d -print0 | xargs -0 chmod 755 find ./ -type f -print0 | xargs -0 chmod 644

    2. Give these folders write permission:

      chmod 777 /path/to/my/webserver/root/magento2/app/etc chmod 777 /path/to/my/webserver/root/magento2/var chmod 777 /path/to/my/webserver/root/magento2/pub/media chmod 777 /path/to/my/webserver/root/magento2/pub/static

    3. Create a blank database. You will need to note the host, username and password to access this database.
    4. cd magento2 and open .htaccess and make these changes:
      • <IfModule mod_php5.c> php_value xdebug.max_nesting_level 500 </IfModule>

      • Enable MultiViews by uncommenting this Options -MultiViews

    5. Browse http://[Magento host or IP]/[path to Magento root]/setup
    6. On the initial page, click Agree and Set Up Magento.
    7. Continue with the following sections to complete the installation. You will get all the details regarding each section at this link:
      • Step 1: Readiness Check
      • Step 2: Add a Database
      • Step 3: Web Configuration
      • Step 4: Customize Your Store

        NOTE: Even though I enabled sample data in the previous step I did not check the "Use Sample Data" check box. What I found, after more than a few failed attempts, the sample data is just too large to install via the web. Instead, I did a normal, empty shop installation and then, after shop installation added the sample data.

      • Step 5: Create Admin Account

        NOTE: Remember, the username you entered here. We will need it to install the sample data.

      • Step 6: Install

        Installation Success! If, there is an error you can see it in the console.log section below on the same page.

    6. Install sample data (Option #2: Enable sample data after installation)

    Now, install the sample data you enabled before. Remember, we did not install the sample data during the Magento 2 Installation step. If, you checked that box by mistake - and installation was successful - good for you! You do not need this step.

    cd magento2 php dev/tools/Magento/Tools/SampleData/install.php --admin_username=[your Magento admin user name]

    Clear the cache

    rm -R var/cache/*

    Browse the Magento frontend and voila, you are done!

    Additional Notes

    • While checking the PHP version if, you get an error like this:
      php --version dyld: Library not loaded: /usr/local/lib/libjpeg.8.dylib Referenced from: /usr/local/bin/php Reason: Incompatible library version: php requires version 13.0.0 or later, but libjpeg.8.dylib provides version 9.0.0 Trace/BPT trap: 5
      then, do this:
      brew update && brew upgrade brew reinstall php56

Schogini's customer service extends beyond the natural boundaries. ~ Timothy Johnson

Schogini assures 24x7 - 6 hour turn around ticket response time and 24 hour Email response time (