Magento is one of the most powerful eCommerce based CMS available in market. Well, maintaining its awesomeness, the magento officials has released Magento 2.x (e.g. 2.0, 2.0.1 etc.). The beginners may face some issue while installing Magento2. So, here is the prefect guide to help them out.
Note: You need PHP 5.6+ to install Magento2
There are multiple ways to install Magento2. You can find more details here.
We will look into the 2 easiest methods .i.e.
Note: You need PHP 5.6+ to install Magento2
There are multiple ways to install Magento2. You can find more details here.
We will look into the 2 easiest methods .i.e.
- Via Terminal/SSH
- Via FTP
1. Installation Via Terminal/SSH
There are two git repository which can be used for installation:
But the first one is recommended for developers.
Now, in order to install Magento2 via Terminal/SSH, continue with following steps:
- Cloning the Git Repository and Setting Up Composer
- Create a new directory for the installation or go to your apache root directory. You may use the command:
mkdir directoryname
- Now navigate to the created directory run the command:
git clone https://github.com/magento/magento2
- After clone is complete, create a file auth.json with the content shown here:
{ "http-basic": { "repo.magento.com": { "username": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "password": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" } } }
You can get your username and password from the secure keys section in your Magento Connect account or visit http://devdocs.magento.com/guides/v2.0/install-gde/prereq/connect-auth.html - Now run the command:
composer install
If you are getting error like: composer: command not found, then you might have not installed composer before on the system, follow this guide to install it and try the run the command again. - After completion of the methods mentioned above, now we will do the final installation. While this process, you may get these errors:
- The requested PHP extension ext-intl * is missing from your system. Install or enable PHP’s intl extension.
- The requested PHP extension ext-xsl * is missing from your system. Install or enable PHP’s xsl extension.
If you get these errors, then you need to install these PHP extensions and restarting the apache server by running these commands one by one:sudo apt-get install php5-intl sudo apt-get install php5-xsl sudo service apache2 restart
You might get this error too:
Your PHP Version is 5.6.20-1+deb.sury.org~trusty+1, but always_populate_raw_post_data = 0. $HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will be removed in PHP 7.0. This will stop the installer from running. Please open your php.ini file and set always_populate_raw_post_data to -1. If you need more help please call your hosting provider.
To fix this open the php.ini (typically located at /etc/php5/apache2/php.ini) which you can find by looking at php_info() output.
Find the following line:
always_populate_raw_post_data = 0
and change it to:
always_populate_raw_post_data = -1
Then restart your apache server (sudo service apache2 restart) to fix this issue.
You might also get an error to upgrade mysql version 5.6 to do so follow this process here. - Now let’s start, installation. Open the following url in your browser:
http://yoururl/setup
It will start the installation wizard and proceed with the steps one by one.
You can install via CLI by running this command:php bin/magento setup:install --base-url=http://
/ / --db-host=localhost --db-name=magento --db-user=magento --db-password=magento --admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com --admin-user=admin --admin-password=admin123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1
2. Installation Via FTP
To install Magento2 via FTP, download the compressed setup file from https://magento.com/tech-resources/download
Upload the file to apache server’s root directory or any desired directory inside it. Unzip the files here and open this url in browser:
http://yoururl/setup
It will start the installation wizard and proceed with the steps one by one.
If you are a developer, then you need to do some more changes. To know about these stuffs, click here.
Comments
Post a Comment