Before you download, consider our cloud solution — Magento Commerce. It's the ideal choice for merchants and developers who need an all-in-one cloud solution that is optimized for Magento Commerce websites, easy to deploy, provides enhanced security, and is packed with additional integrated capabilities to accelerate sales. In order to install Magento on MacOS, we need to first download the file by visiting its official website the file into /Library/WebServer/Documents and run the following command.
Introduction
Magento is an open source e-commerce platform developed by Varien Inc. It was completely written in PHP and was released on March, 31st 2008. It was acquired by e-bay which released Magento2 on November 17, 2015. In this tutorial, we will install Magento on MacOS.
Prerequisites
- MacOS
- Login as an administrator on terminal
- PHP Extension dom.
- PHP Extension Curl.
- PHP Extension mcrypt.
- PHP Extension simplexml.
- PHP Extension spl.
- PHP Extension xsl.
- PHP Extension intl.
- PHP Extension mbstring.
- PHP Extension ctype.
- PHP Extension hash.
- PHP Extension openssl.
- PHP Extension zip.
- PHP Extension xmlwriter.
- PHP Extension gd.
- PHP Extension iconv.
Installation
Installation includes following steps.
1. Download and Extract the file
In order to install Magento on MacOS, we need to first download the file by visiting its official website https://magento.com/tech-resources/download.Extract the file into /Library/WebServer/Documents and run the following command.
2. Start the development server
Navigate to the directory in which Magento is extracted and run the following command to start the PHP development server.
3. Access on browser
We just need to type localhost:8080in the browser's search bar to access Magento on browser and we will get a browser screen appeared like following.
Click on Agree and setup Magento to navigate to the next step.
Click on Start Readiness check and the system will start checking for the requirement fulfilment.
This step prompts us to fill our database details. For this purpose, we need to create a MySQL database by running following command.
Where root is the username and 123 is the password. We can now create the database by typing the following command on MySQL shell.
Now we can fill the database details as follows.
Hence, now we got magneto installed on our MacOS. Use username and password to login to the website.
Please see our September 2017 blog ‘How to Install Magento 2 For Your eCommerce website‘ for the most up-to-date information on this installation.
In this blog, I will teach you how to install Magento 2 on a Mac for local development. In this instance, we will not being using Vagrant, or any virtual layer. It’s a direct installation.
System Requirements
1. For the web server, we will use MAMP. If you’re not familiar, MAMP is an excellent tool for setting up a local server environment. We use the free version.
2. PHP will need to be version 5.6.x and up (MAMP will include those versions).
3. MySQL 5.6. The default MAMP MySQL (version 5.5) will not work for Magento 2, which requires MySQL version 5.6. We will need to install an additional MySQL database server to make this work properly. You can get it from here. Also make sure you use a different port from MAMP MySQL. I am aware that you can probably replace or update MAMP MySQL to use version 5.6 but i did it this way because it faster. If you want to find out more about integrating mysql into MAMP, you can check out this MAMP blog. But to me it too much additional work to do.
Installing MySQL 5.6.28 on Mac
1. Download the DMG file from this link: http://dev.mysql.com/downloads/mysql/5.6.html#downloads
2. Mount your DMG (I was able to do this by double-clicking the download) and a window should pop up.
3. Run the .pkg file and the installation window will pop up.4. Click Continue > Continue >Agree > Install > Close
5. Now you should have the correct version of the MySQL database running on port 3306. You may need to restart it. You can connect to it with many database clients or using the command line.
Other Software
You will also need
- GIT to get Magento 2 files from the Github repository.
- Composer. download and install Composer to install Magento 2.
After you install composer and you get PHP error when running composer that you need a 5.6 at least, it might be because the php you have on your Laptop is what is running from command line(mac has build-in php), and not the php in mamp.
How to fix it:
Magneto Software
type:
to verify.
if you see /usr/bin/php you know it is using the Mac version.
Find the path to your MAMP php by going to:
now look at the versions and choose the path to one 5.6 or greater.
and add this lines:
PHP_VERSION=`ls /Applications/MAMP/bin/php/ | sort -n | tail -1`export PATH=/Applications/MAMP/bin/php/${PHP_VERSION}/bin:$PATH
Magento 2 Installation
1. First you will need to configure Apache to handle the Magento 2 path. In my case, I used http://local.magento2:8888/ This can be set up in your /Applications/MAMP/htdocs
how to set it? I’m preaty sure there is many articles on that. Here is piece of virtual host configuration
# Magento_2
<VirtualHost *:8888>
ServerAdmin ********@*****.***
DocumentRoot “/Applications/MAMP/htdocs/magento2”
ServerName local.magento2
ServerAlias local.magento2
ErrorLog “logs/local.magento2-error”
CustomLog “logs/local.magento2-access” common
</VirtualHost>
2. Get Repository. Run the following command to download the Magento 2 dev files:
3. Create the database. Let’s call it magento2
4. Start terminal and cd to magento 2 root folder. From there run:
Again, you can download composer here.
3. After composer is done, cd to [magento2_instalation]/bin folder and from there, run the following:
You will have to fill some parameters with your related data.
Here is full list of parameters available for install:
setup:install [–backend-frontname=”…”][–key=”…”][–session-save=”…”][–definition-format=”…”][–db-host=”…”][–db-name=”…”]
[–db-user=”…”][–db-engine=”…”][–db-password=”…”][–db-prefix=”…”][–db-model=”…”]
[–db-init-statements=”…”][-s|–skip-db-validation][–http-cache-hosts=”…”][–base-url=”…”][–language=”…”]
[–timezone=”…”][–currency=”…”] [–use-rewrites=”…”] [–use-secure=”…”] [–base-url-secure=”…”]
[–use-secure-admin=”…”] [–admin-use-security-key=”…”] [–admin-user=”…”] [–admin-password=”…”]
[–admin-email=”…”] [–admin-firstname=”…”] [–admin-lastname=”…”] [–cleanup-database]
[–sales-order-increment-prefix=”…”] [–use-sample-data] [–magento-init-params=”…”]
Mac Downloader
Note that base-url is not a required option.
And after you done. Go to http://local.magento2:8888/ and you should see site like below.
Configuration
Joomla Mac Download
Now that you’ve finished installing the Magento application, you need to configure it. Post-install configuration settings will include:
- Setting up cron
- Configuring the security settings
- Enabling the Apache server rewrites
- Configuring the Server settings
- Settings for Magento Enterprise Edition (EE) only
Mac Download Software
For more information on Magento 2 installation and configuraion, visit the Magento 2 Documentation.