Reading list Switch to dark mode

    Magento 2 Setup in MacOSX

    Updated 25 April 2023

    In this tutorial we will explain you can set up Magento 2 using MacOS X El Capitan . Well, it’s fairly easy but still, there are a few tweaks which need to be sorted out.

    As I am using MAMP basic with PHP7 support so almost all the dependencies of the like curl mcrypt and others which you will find during the setup of php 5.x.x.

    As MAMP comes with MySQL 5.5 so you need to upgrade it to 5.6.

    There are two ways to install Magento 2 on macOS.

    Using composer

    Searching for an experienced
    Magento 2 Company ?
    Find out More

    Using file archive

    In this tutorial, we will download the setup from the Magento site and will extract it under htdocs folder under Application/MAMP as per the screenshot

    Screen Shot 2016-05-09 at 8.14.41 PM

    Now simply go to the browser and set up the database and setup configuration and you are done.

    Well if you think all is done actually it’s not this is just a start. Now suppose you are going to start a module development using the same platform setup and you run the following command. As I run the Magento 2 compilation command it generates the following error:

    Use of undefined constant MCRYPT_BLOWFISH

    It should not be there as php7 already supports that well it’s been quite a pain for me but finally, I got the issues when I typed the command

    php-v I came to know that the php version is still displaying 5.x.x WTH why it’s there as my MAMP setup is still php7

    Screen Shot 2016-05-09 at 8.43.01 PM

    So what I did create a .bash_profile under my home directory and added the path of php7 as below:

    export PATH=/Applications/MAMP/bin/php/php7.0.0/bin:$PATH

    Make sure after saving the file you execute the “source .bash_profile” command and make sure you are not getting an error.

    Well now your Mcrypt issues must be solved.

    Now I execute again the command “php bin/magento setup:di:compile” again this time got the

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 24 bytes) in \vendor\zendframework\zend-code\src\Scanner\FileScanner.php on line 36

    This issue was because of less memory allocation in the php.ini file which you can overcome by simply running through the command line.

    “php -dmemory_limit=1G bin/magento setup:di:compile” but it’s a temporary solution you can edit it in php.ini and it will work perfectly ok.

    Screen Shot 2016-05-09 at 9.04.18 PM

    That is all for the Magento 2 macOS installation article, for more updates, keep visiting Webkul Blog space. For anymore queries related to Magento 2 installation, reach out to our team [email protected]

    . . .

    Leave a Comment

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


    Be the first to comment.

    Back to Top

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home