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.
Lets jump right into it and start with getting the environment ready.
You must have PHP version 5.5.x or above.
brew link --overwrite autoconf brew link mhash brew install php56-mcrypt brew link --overwrite mcrypt brew install php56-mcrypt sudo apachectl restart
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
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:
In this example, the webserver's user is _www
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
Search for your webservers directory section and change
AllowOverride None to
AllowOverride All. On my system it looks like this:
Whew! Ok, with all that in check lets start the actual installation process. (And the fun begins...)
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!
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:
curl -sS https://getcomposer.org/installer | php
cp composer.phar /usr/local/bin/composer
I used the SSH method but, you can definitely opt to use the HTTPS method. Both the methods are described at this URL: http://devdocs.magento.com/guides/v1.0/install-gde/install/composer-clone.html#instgde-prereq-compose-clone
I followed these steps:
IMPORTANT: Ensure that you are logged in as your webserver's user
cd [your document root]
git clone <the clone URL you copied before>
git clone https://github.com/magento/magento2.git
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.
find ./ -type d -print0 | xargs -0 chmod 700
find ./ -type f -print0 | xargs -0 chmod 600
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
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. http://artarmstrong.com/blog/2014/12/23/how-to-fix-composer-update-failure-due-to-github-authorization/
This what I did:
composer config --global github-oauth.github.com <token>
This command updates package dependencies and will take a few minutes to complete.
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):
Option #1: Enable sample data before installation
When I installed Magento 2 the latest version was 0.42.0-beta11
This URL has the complete list of sample data versions: http://packages.magento.com/#magento/sample-data
Generally, the sample data's version will match the version of Magento 2 you downloaded.
"minimum-stability": "beta", before
"description": "Magento project (Community Edition)",
composer config repositories.magento composer http://packages.magento.com
composer require magento/sample-data:<version>
At last we have reached the step where you start the installation. You have 2 options here:
I choose the Seup Wizard Installation and here are the steps I followed:
find ./ -type d -print0 | xargs -0 chmod 755
find ./ -type f -print0 | xargs -0 chmod 644
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
cd magento2and open .htaccess and make these changes:
php_value xdebug.max_nesting_level 500
Enable MultiViews by uncommenting this
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.
NOTE: Remember, the username you entered here. We will need it to install the sample data.
Installation Success! If, there is an error you can see it in the console.log section below on the same page.
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.
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!
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
brew update && brew upgrade brew reinstall php56
Schogini assures 24x7 - 6 hour turn around ticket response time and 24 hour Email response time (firstname.lastname@example.org)