Skip to main content

Magento2 Installation Guide: Part 1

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.

  1. Via Terminal/SSH
  2. Via FTP

1. Installation Via Terminal/SSH

There are two git repository which can be used for installation:
  1. https://github.com/magento/magento2
  2. https://github.com/magento/magento2-community-edition
But the first one is recommended for developers.

Now, in order to install Magento2 via Terminal/SSH, continue with following steps:
  1. Cloning the Git Repository and Setting Up Composer
  2. Create a new directory for the installation or go to your apache root directory. You may use the command:
    mkdir directoryname
    
  3. Now navigate to the created directory run the command:
    git clone https://github.com/magento/magento2
    
  4. 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
  5. 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.
  6. After completion of the methods mentioned above, now we will do the final installation. While this process, you may get these errors:
    1. The requested PHP extension ext-intl * is missing from your system. Install or enable PHP’s intl extension.
    2. 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.
  7. 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

Popular posts from this blog

DataTable with PHP and MySQL

Data representation in form of tables and grid is one of the most import web component. Generally we need to perform sorting, pagination on it, which is very complex task to do. To solve this problem, many grid view framework are there. Well, among these frameworks, DataTable is most popular. Features like open source, light weighted, highly flexible and customizable, features like AutoFill, inline editor, sticky header, responsiveness, bootstrap support and foundation are the reasons behind its popularity. In basic initialization datatable provides pagination, sorting, instant searching by loading whole data records at once. It can be a performance issue fetching large amount of data from server side. It will be better if you integrate server side pagination, searching and sorting, so we can break large amount data in chunk, So performance will increase significantly. Let’s have a look about using and customizing it. We need to include plugin files (js & css) and fetch data f

Delete All Products at Once | Magento

Well, usually during development, you may need to add some test products (Sample Data) which needs to be removed before moving the site to production. If the volume is large, then it would be very difficult to delete it from the Product Grid. In this case, you may need some trick. Well, you can use the following method: 1. Log into MySQL server via CLI or phpMyAdmin 2. Run the following SQL Queries and it will do the job: SET FOREIGN_KEY_CHECKS = 0; TRUNCATE TABLE `cataloginventory_stock_item`; TRUNCATE TABLE `cataloginventory_stock_status`; TRUNCATE TABLE `cataloginventory_stock_status_idx`; TRUNCATE TABLE `cataloginventory_stock_status_tmp`; TRUNCATE TABLE `catalog_category_product`; TRUNCATE TABLE `catalog_category_product_index`; TRUNCATE TABLE `catalog_category_product_index_tmp`; TRUNCATE TABLE `catalog_compare_item`; TRUNCATE TABLE `catalog_product_bundle_option`; TRUNCATE TABLE `catalog_product_bundle_option_value`; TRUNCATE TABLE `catalog_product_bundle_price_index`; TR

Why PHP Is Best For Web Development

While working on any website of web application, the first question that comes in mind is which programming language is best. If you ask programmers, they might love or hate PHP as server side scripting language. Well the opinions may vary but there are several reasons which make PHP one of the best programming language for web development. Here are 5 best reasons to love PHP (Hypertext Preprocessor): Less Expensive It requires no licensing fee and it has less expensive hosting servers available. Its software are mostly free and open source which makes it less expensive. Faster Web apps which are developed on PHP are comparatively faster as it uses its own memory space to run. Database Flexibility Well, one of the best reasons to love PHP is its flexibility towards databases. It can connect to several databases the most commonly used is the MySQL.  MySQL can be used for free. Very Good Documentation PHP also has very good online documentation with a good framework of f