官术网_书友最值得收藏!

Getting the Magento code base

The first step is to get the latest version of the Magento code base. In order to do that, you should visit the Magento download page (https://magento.com/tech-resources/download) and choose the latest version of Magento:

In order to have products, categories, and other useful information for our local Magento installation, we will choose the latest version from the Full Release with Sample Data (ZIP with sample data) section:

Once you download the file, you should uncompress it in the document root of your local machine.

After uncompressing the file, you should see a similar output to the following screenshot:

Now, we have the code base in place to move ahead with the installation.

There are two ways of installing Magento:

  • Setup Wizard installation
  • Command-line installation

Setup Wizard installation

The Setup Wizard is a simple installation process that is performed from the browser.

In order to install Magento using the Setup Wizard, you should follow these steps:

  1. Open your favorite web browser.
  2. Go to the http://<host name>/setup Setup Wizard URL. The host name is the one that you assigned in your virtual host configuration for the local Magento 2 installation. For example, in this section we declared magento2-playground.dev as the host name, so the URL for the Setup Wizard will be http://magento2-playground.dev/setup.
  3. Click on Agree and Setup Magento to proceed to the first step of the installation:
  4. Readiness Check: In this step, the Setup Wizard will check whether your local machine is ready for Magento 2, reviewing the following things:
    • PHP version
    • PHP settings
    • Enabled PHP extensions
    • File permissions

    When the check is performed, you will receive confirmation to move to the next step:

  5. Add a Database: In this step, you will specify the connection details for the empty database that you created for the Magento 2 installation:
  6. Web Configuration: In this step, you should specify the virtual host that you created for the Magento 2 website (autocompleted by default), and you can define a custom URL for the admin as well as Advanced Options, such as HTTPS Options, Apache Rewrites, Encryption Key, and the Session Save configuration.
  7. Customize Your Store: This step includes the time zone, currency, and language configuration, as well as the list of modules from Magento to enable/disable for the instance:
  8. Create Admin Account: In this step, you can create the first user for the Magento Admin panel:
  9. Install: This is the final step and you will find an Install Now button to proceed with the installation. When you click on that button, Magento will proceed with the installation. You will be able to keep track of the installation by looking at the progress bar. In addition to that, you can open the console log using the link below the progress bar to see the full report of the progress for the installation. Since we are installing Magento with sample data, the Setup Wizard will take time to install all the products, categories, attributes, and so on. When the installation is finished, you should see the following success page in the Setup Wizard:

Command-line installation

The command-line installation is the alternative method that Magento provides to install Magento 2 from the Terminal.

These are the steps to proceed with the installation:

  1. Open the Terminal and go to the directory of your local Magento installation.
  2. The command-line installation is done using the Magento 2 command-line tool. You can confirm that you are in the right directory by running php bin/magento. You will see the output with a list of all the commands from the Magento 2 command-line tool:
  3. The next step is running Composer in the project directory. If you don't have Composer installed in your local machine, you can follow the instructions on the official Composer website: https://getcomposer.org/. Then, you should run the following command in the Terminal:
     composer install
    

    If everything goes well, you should see an output similar to the following:

  4. Finally, you should run setup:install to install Magento with your local configuration.That said, this is a long command and you can customize it to match your local configuration. We will review each of the parameters in the command:
     php bin/magento setup:install --db-host=localhost --db-name=magento2playground --db-user=root --db-password=root --backend-frontname=admin --admin-user=admin --admin-password=ABC123xyz --admin-email=email@sample.com --admin-firstname=Gabriel --admin-lastname=Guarino --base-url=http://magento2-playground.dev/ --language=en_US --currency=USD --use-rewrites=1 --use-secure=0 --use-secure-admin=0
    
    • db-host: Host for your local database (localhost or 127.0.0.1)
    • db-name: Name of the empty database for the Magento installation
    • db-user: MySQL username
    • db-password: MySQL password
    • backend-frontname: URL (frontname) for the Magento Admin panel
    • admin-user: Username for your first admin user
    • admin-password: Password for your first admin user
    • admin-email: E-mail for your first admin user
    • admin-firstname: First name for your first admin user
    • admin-lastname: Last name for your first admin user
    • base-url: Base URL for the local Magento installation
    • language: Language for the Magento installation
    • currency: Currency for the Magento installation
    • use-rewrites: Enable/disable URL rewrites
    • use-secure: Enable/disable HTTPS on the frontend
    • use-secure-admin: Enable/disable HTTPS in the admin panel

    After running the setup command, you will see the following output confirming that the installation has been successfully completed:

Now that you have installed Magento on your local machine, you can access Magento using the URL that you declared before.

The URL to access the frontend will be http://magento2-playground.dev/:

The URL to access the Admin Panel will be http://magento2-playground.dev/admin/:

主站蜘蛛池模板: 大理市| 谢通门县| 尼木县| 镇坪县| 富裕县| 梓潼县| 仙游县| 临夏县| 缙云县| 道真| 潼关县| 金川县| 乐清市| 泸水县| 阜阳市| 神池县| 易门县| 朝阳县| 台北市| 搜索| 栾川县| 前郭尔| 柘荣县| 亚东县| 威海市| 道真| 两当县| 红桥区| 湟源县| 安泽县| 吉水县| 江华| 班戈县| 瑞昌市| 绥阳县| 兴山县| 抚宁县| 绥德县| 卢龙县| 喀什市| 镇巴县|