Loading..
Processing... Please wait...

Product was successfully added to your shopping cart.



How to install Magento 2.1.1 with Sample Data on MacBook Air OS X 10.11.6 El Capitan

I will show you how to install Magento 2.1.1 on a stock MacBook Air OS X 10.11.6 El Capitan. Detailed explanation of what to do you could find below.

It will not require programming. The only toll you will use that you might not know is Terminal Software that is preinstalled on any MacBook.

Installation will require around 2G of free disk space.

Video tutorial is available below.

 

Terminal Software

I will be using Terminal program. Its preinstalled on MacBook Air and you can find it with Spotlight Search.

Terninal | Install Magento 2 on MacBook Air | Goivvy.com Terninal | Install Magento 2 on MacBook Air | Goivvy.com

Terminal lets you run command line programs and it is very useful.

Download Magento 2.1.1

Go to https://www.magentocommerce.com/download and choose a file format that suits you best. I will pick Magento 2.1.1 zip archive with sample data.

Download Magento 2 | Official Magento Website | Goivvy.com Download Magento 2 | Official Magento Website | Goivvy.com

Once downloaded extract its content into /Library/WebServer/Documents folder. OS X El Capitan has Apache web server preinstalled and this is its root folder.

Issue these commands in Terminal:

cd /Library/WebServer/Documents
unzip /Users/konstantin/Downloads/Magento-CE-2.1.1_sample_data-2016-08-29-06-38-09.zip

Then you will need to find a username Apache is running under and make sure the user can write to /Library/WebServer/Documents.

Run:

ps aux|grep httpd
Apache Username | Install Magento 2 on MacBook Air | Goivvy.com Apache Username | Install Magento 2 on MacBook Air | Goivvy.com

The first columns is our user - _www.

Switch to root user:

sudo bash

and change permissions

chown -R _www:wheel /Library/WebServer/Documents
chmod -R 775 /Library/WebServer/Documents

Now Magento 2 code files are ready.

 

Install and setup MySQL 5 Database Server

Go to http://dev.mysql.com/downloads/mysql/ and download MySQL Community Server for Mac OS X. Choose DMG Archive.

Download MySQL 5 Server | Install Magento 2 on MacBook Air | Goivvy.com Download MySQL 5 Server | Install Magento 2 on MacBook Air | Goivvy.com

Once downloaded double click on the file and follow instructions. It should be a simple next-next installation.

Important: It will generate root mysql password for you - copy it for later use.

Once installed you need to start MySQL Server - go to System Preferences and click on MySQL icon at the bottom.

Start MySQL Server | Install Magento 2 on MacBook Air | Goivvy.com Start MySQL Server | Install Magento 2 on MacBook Air | Goivvy.com

Then click on start the server

Window to Start MySQL Server on Mac OS X | Install Magento 2 on MacBook Air | Goivvy.com Window to Start MySQL Server on Mac OS X | Install Magento 2 on MacBook Air | Goivvy.com

That is it. MySQL Server should be up and running.

Now we need to create a database for our Magento 2.

Run in terminal:

mysql -uroot -p

then enter mysql root password you copied earlier.

Once in mysql command mode issue:

create database magento2;
grant all on magento2.* to 'magento2'@'localhost' identified by 'demo123';

Now we have created MySQL Database:

  • username - magento2
  • database - magento2
  • host - localhost
  • password - demo123

 

Prepare Apache Web Server and upgrade PHP

You will need to edit Apache settings. Enable rewrite_module - edit file /etc/apache2/httpd.conf and uncomment:

LoadModule rewrite_module libexec/apache2/mod_rewrite.so

In the same file search for <Directory "/Library/WebServer/Documents"> and a couple of lines below it change AllowOverride to All:

AllowOverride All

Now Magento 2 can overwrite apache settings with .htaccess file.

Magento 2 requires PHP 5.5+. By default MacBook Air OS X El Capitan has PHP 5.4 so we need to upgrade it.

Please follow these instructions to upgrade PHP 5 on El Capitan https://coolestguidesontheplanet.com/upgrade-php-on-osx/

I will put a command here if the above link goes dead: run this in terminal as root:

curl -s http://php-osx.liip.ch/install.sh | bash -s 5.6

you PHP should now be upgraded.

Create a simple phpinfo.php file inside /Library/WebServer/Documents with the content:

<?php echo phpinfo() ?>

Then follow this link http://localhost/phpinfo.php - you should see PHP 5.6

 

Install Magento 2 with Setup Wizard

Now go to http://localhost - it should redirect you to Magento 2 Installation Page.

Magento 2 Setup Wizard | Install Magento 2 on MacBook Air OS X El Capitan | Goivvy.com Magento 2 Setup Wizard | Install Magento 2 on MacBook Air OS X El Capitan | Goivvy.com

Follow instructions and let Magento 2 install itself automatically.

 

If you find this post interesting do not hesitate to sign up for our newsletter and join the 636 people who receive Magento news, tips and tricks regularly.

Thank You!

 

 

One thought on “How to install Magento 2.1.1 with Sample Data on MacBook Air OS X 10.11.6 El Capitan”

  • CathyRoberson

    First, I would like to say I love your writing and blog topics as they teach and provide me with so much insight about engaging. I am still new to it and find your knowledge so valuable.