Intro to Magento
Magento is a popular (as a matter of fact), #1 framework of e-commerce platform. In this article, I will go through mostly installation , and furthermore precautions, troubleshooting for installations of magento.
As magento is a web framework and is a big framework, to test it we should have a server platform. Magento 1 has been released on March 2008, Magento 2 has been released on November 2015. Currently Magento 1 and Magento 2 exist together.
In local, for mac we can do a MAMP and for windows, we could use XAMPP, although I only used MAMP. Even using MAMP, there are things that could go wrong, especially setting up mysql and php. After setting up MAMP, there are two ways to install magento.
One is to use composer, and one is to get a zip file and unzip it.
I actually only have experience with MAMP, so I’ll just right about that only.
When setting up MAMP environment, there are few things to be careful.
First is from which php is your php actually implemented.
When using MAMP, you should use the php internally installed in the MAMP,
but mac has its own php installed originally, so we should direct to the MAMP’s php.
paulmestereaga.com/install-magento-2-locally-mamp would be a good reference.
You would have to install it inside a directory(you could make it via finder or terminal)
inside /Applications/MAMP/htdocs/
.
To be specific, if which php
command of terminal is /usr/bin/php
then we should change it.
We can edit .bash_profile
to sudo vi ~/.bash_profile
and add the line and save it.
export PATH=/Applications/MAMP/bin/php/php7.0.0/bin:$PATH
Then run source ~/.bash_profile
.
Installing without composer is trivial so I won’t go through it. Installing with composer would actually
require installing composer, and then composer create-project --repository=https://repo.magento.com/magento/project-community-edition magento2
to get the latest version.
If you have error regarding permission, run sudo chmod -R 775 /path to magento2
.
After this, we should make the database for the MAMP environment.
To make database, you can go to http://localhost:8888/phpmyadmin
.
Also, you can use other sql programs like MYSQLWORKBENCH with the credentials as
change the connection type from TCP/IP to Local
, and then point to the socket
/Applications/MAMP/tmp/mysql/mysql.sock
and username and pw.
username and pw will be most likely root and root.
Similarly, we can access by terminal type in
/Applications/MAMP/Library/bin/mysql --host=localhost -uroot -proot
.
`