Magento CE 2.2.2 (With Sample Data) Installation

I want to install Magento CE 2.2.2 (with sample data) in my machine MacOS High Sierra (10.13.2), PHP 7.0 and Apache2. For the installation on Ubuntu 16.04 with Nginx and PHP7.0-FPM, See after this.

  1. Download the installation file from magento website (https://magento.com/tech-resources/download). I downloaded the file with sample data in tar.bz2 format
  2. Extract the compressed file into your web root. I extract them in ‘magentoce222’ directory.
  3. Create a virtualhost
    Modify /usr/local/etc/httpd/extra/httpd-vhosts.conf. then add this:

    Save the file.
    Then modify /private/etc/hosts. Then insert this:

    Save the file.
    Then restart apache server

     
  4. Open the site on the browser: http://magentoce222.local/
    Follow the instruction (Agree the terms and condition, check the readiness, the database addition (create the database manually), web config, timezone (mine: western indonesia time (indonesia/jakarta)
    So here is the local config:

    SORRY, ONLY ADMIN CAN SHOW THIS!
    Then click ‘Install’ button.
    Success!
  5. When I opened the admin page, it need to be reindexed and the cache need to be cleared:
  6. On the frontpage, I got the grid for the products (hot sellers section) not good enough. not like on http://magentoce215.local/
  7. INSTALL MSP VIA COMPOSER:

    Enable it:

    run setup:upgrade

    Then enable it also in the admin page : Stores -> Configuration -> MAGESPECIALIST
    NOTE: I GOT THIS ERROR AFTER ENABLE IT:
    One or more integrations have been reset because of a change to their xml configs.
    SOLUTION: I NEED TO DISABLE AN EXTENSION:
    php bin/magento module:disable Shopial_Facebook
    REF: https://github.com/magento/magento2/issues/12095

The installation on Ubuntu 16.04 with Nginx and PHP7.0-FPM
ref: http://devdocs.magento.com/guides/v2.0/install-gde/prereq/nginx.html

  1. Download Magento 2.2.2 (with sample data)
  2. Create the config file

    Here is the content:
  3. Enable file config
  4. Register the host on my system

    Like this:
  5. CHECK THE NGINX SETTING AND RESTART IT:


     
  6. Set file permission and owner:

    Then

     
  7. Test: –> NOT WORKING! I GOT BLANK PAGE. MAY BE SOMETHING WRONG ON NGINX ‘magento222.test’ CONFIG ERROR. BUT WHERE?
    IT ALSO REALLY WORTH TO CHECK THE ERROR MESSAGE FROM /var/log/nginx/error.log
    OK. I FOUND THE SOLUTION (ref: https://github.com/magento/magento2/issues/2504). I CAN DO ONE OF THIS SOLUTION (THE LATTER IS PREFERRED):
    1. CHANGE ‘cgi.fix_pathinfo’ TO ‘1’ IN /etc/php/7.0/fpm/php.ini
    2. MODIFY THE CONFIG FILE IN /etc/nginx/sites-available/magento222.test THEN ADD ‘fastcgi_split_path_info ^(.+?\.php)(/.*)$;’ JUST BELOW/IN ‘location ~ ^/setup/index.php {‘. PLS SEE THE FIXED SETTING ABOVE –> PREFERRED. BECAUSE  THIS PROBLEM ONLY WHEN I TRIED TO SETUP FOR THE FIRST TIME.
    I ALSO GOT ‘connection timeout’ ERROR WHEN TRYING TO INSTALL IT. SO I ADDED A FEW MORE LINES ON ‘setup’ SECTION ON THE NGINX CONFIG LIKE THIS:

    ref: https://www.digitalocean.com/community/questions/nginx-php5-fpm-error-110-connection-timed-out
    MAY BE I NEED TO DO THE SAME ON THE ‘update’ SECTION???
    3. To enable Magento 2 profiler for nginx, pls add ‘fastcgi_param MAGE_PROFILER html;’ like this:

    NOTE: THE PROFILER WOULD SLOW THE PAGE LOAD!!!
    ref: https://magento.stackexchange.com/questions/192401/how-to-enable-profiler-on-nginx

    I HAVE TO USE APACHE TO INSTALL IT
    SORRY, ONLY ADMIN CAN SHOW THIS!

  8. Compile

     

    OR (BECAUSE I GOT ERROR: ‘Area code not set: Area code must be set before starting a session. … vendor/magento/framework/Session/SessionManager.php’)


    Make sure the php version for cli is php 7.0.x (php 7.0.x for magento 2.2.2), if not, pls change the php cli version:

    If you get an error like ‘Class Magento\Framework\App\ResourceConnection\Proxy does not exist’ on the cli and/or the browser, then you need to remove ‘generated’ directory first.

    then run the setup:upgrade and the other commands like usual
    I GOT ANOTHER ERROR:

    SO REMOVE SOME FILES MANUALLY:

    RUN THE DEPLOY COMMAND AGAIN!
  9. Test:  http://magento222.test/
    Admin page: http://magento222.test/admin_14p856

Leave a Reply

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