Submit a Ticket
Support Center » Knowledgebase » Tutorials: Step-by-Step Help » How to Install Magento 2.1.2 on Windows VPS (IIS)

How to Install Magento 2.1.2 on Windows VPS (IIS)

How to Install Magento 2.1.2 on Windows VPS (IIS)

First, you need to make sure that the MySQL version on your server is version 5.6. Login to the server via Remote Desktop. Click on Start





Write down cmd and start the command prompt:




Navigate to the mysql bin directory.
For example:
cd C:\Program Files\MySQL\MySQL Server 5.6\bin
Execute the following command:
mysql -h localhost -V
The result of the command will be similar to:
mysql  Ver 14.14 Distrib 5.6.34, for Win64 (x86_64)

Magento 2.1.2 requires mysql 5.6 so we can continue. If your server is using mysql version less than 5.6 then first you will need to upgrade the mysql. For more information about how to do that check the official information provided by mysql:
https://dev.mysql.com/doc/refman/5.5/en/windows-upgrading.html

Next thing to do is install the latest php version available. Click again on start and search for Microsoft Web Platform Installer. If it is missing you can download and install it from the following link:
https://www.microsoft.com/web/downloads/platform.aspx?lang=

After the installation is completed click again on start and search for Microsoft Web Platform Installer.
In the search bar type php and select the php versions you want to install on the server:



In this tutorial we will install all versions from php5.3 to php7.0. Also make sure that PHP Manager  for IIS is marked for installation and click Install.

Set the PHP version to 7.0 from IIS for your website:





In this tutorial we configure the php version for the default website. You can make such configuration for any website in IIS. Make sure that php_intl.dll and php xsl.dll are enabled.
You can enable and disable extensions from PHP Extensions option in PHP Manager. It is recommended to set php memory to 256MB from PHP Manager→ Set Rutime limits



Installing and Configuring Magento on Your Local Machine
After you have setup IIS, MySQL and PHP on your local machine, download the source code from Magento’s website.
https://magento.com/tech-resources/download
Extract the contents using a decompression program such as WinZip or 7-Zip.
In order to avoid one of the common issues during Magento configuration open  file .\setup\src\Magento\Setup\Validator\DbValiditor.php in a text editor and edit line 106 and change it from:

return $this->checkDatabaseName($connection, $dbName) && $this->checkDatabasePrivileges($connection, $dbName);

To:
return $this->checkDatabaseName($connection, $dbName);

This way you will avoid issues with some privileges of the database username.

Access the website where you will install magento in your browser and the installation will start:



Click on the Agree and Setup Magento button to continue.
 
Readiness Check
Click on the Start Readiness Check button (e.g. you might need to enable some PHP extensions before you can continue. You can enable and disable extensions from PHP Extensions option in PHP Manager.). Click on the Next button if everything checks out.




Add a Database
On this page, fill out the fields with the connection string information to your database. You can create database via the Panel you use with your server or via command line. We are using manually created database in this tutorial Click on the Next button to proceed.



Web Configuration
You need to configure Your Store address and Magento admin address. It is recommended to change both values to custom one and uncheck  Apache Rewrites from the Advanced options. Click on the Next button to continue.



Customize Your Store
On the next page you can make custom configuration per your needs and click Next.



Create Admin Account



Install



Now open up the command prompt with Run as administrator and navigate to Magento’s bin directory and type in the following command:

php magento setup:static-content:deploy



This will deploy the necessary files to the \pub\static directory that will render Magento’s UI correctly. If it’s successfully, you should get the following message:
New version of deployed files: 1480065378

Create a web.config file with the following markup and place it in the root of the Magento installation:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="Imported Rule 1" stopProcessing="true">
          <match url=".*" ignoreCase="false" />
          <conditions>
            <add input="{URL}" pattern="^/(media|skin|js)/" ignoreCase="false" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
          </conditions>
          <action type="Rewrite" url="index.php" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

This is required so you can access the Admin Interface.

Here are two screenshot of the completed Magento installation:

 


 This answer was helpful  This answer was not helpful
 Back