Step 1: You can visit Oracle Help Center for Installation of the JDK and the JRE on Microsoft Windows Platforms and to download JDK visit download page. Click on the version you want for your system, it will ask for Terms and Conditions approval, once confirmed it will start downloading files. I have downloaded “jdk-15_windows-x64_bin.exe” then installed it in my system.
Step 2: To install JDK, open the download folder of your windows 10 system. Double click on the executable file (in my case “jdk-15_windows-x64_bin.exe“). Windows will ask for permission to allow installation in the system, once allowed (by clicking Yes), the system will process further. Follow the steps during installation process as shown below in images:
Step 3: After the installation is complete, delete the downloaded file to recover the disk space. (Optional)
Step 4: You can verify your JDK installation by visiting your installation path of JDK. In my case it is “C:\Program Files\Java\jdk-15“.
Step 5: Setting the PATH Environment Variable, so that Java is accessible globally in the system.
To set the PATH variable permanently, add the full path of the “C:\Program Files\Java\jdk-15\bin” directory to the PATH variable.
Select Control Panel and then System.
Click Advanced and then Environment Variables.
Add the location of the bin folder of the JDK installation to the PATH variable in System Variables, as a new line entry.
public static void main(String[] args) {
System.out.println(“Hello World”);
}
Public: Type: Access modifier Description: In the above program using public makes main() method globally available. Public method specifies from where and who can access the method. Public methods can be invoked by JVM (Java Virtual Machine) from outside of the class, in the same program file or any other java program file.
Static: Type: Keyword Description: JVM invokes static main() method without instantiating the class which, also, in turn saves the unnecessary wastage of memory while calling object(s) declared for calling the main() method.
Void: Type: Keyword Return Type: Void Description: Void is used to specify that a method doesn’t return anything.
main: Type: Identifier Description: JVM looks for main() as the starting point of the java program.
String[] args: Type: Array of type java.lang.String class Description: It stores Java command line arguments.
System: Type: Class Description: System is a final class in the java.lang package
out: Type: Variable Description: Out is a public and static member of the System class and is an instance of java.io.PrintStream
println: Type: Method Description: The println is a method of java.io.PrintStream, which prints any argument passed while adding a new line to the output.
Here I am upgrading PHP 7 version: chose version (7**) Non-thread-safe 32/64-bit I am downloading the “php-7.3.21-nts-Win32-VC15-x64.zip” version as per my need.
Step 3: Once downloaded. Expand the zip file into the path C:\YOUR-XAMPP-FOLDER\php7**
Step 4: In the C:\YOUR-XAMPP-FOLDER\php7** folder, rename the file php.ini-development to php.ini, it may ask for administrator access, allow it.
Step 5: Edit the php.ini file in a text editor (e.g. Notepad++, Atom, or Sublime Text).
Step 6: Change the following settings in the file and save the file: Change memory_limit from 128M to 2G (because Composer can use lots of memory!) (For Magento reference)
Step 7:Uncomment the line that reads ; extension_dir = "ext"
Step 8: In the section where you find a bunch of extension= lines, uncomment the following required (For Magento reference) lines: extension=php_gd.dll extension=php_curl.dll extension=php_mbstring.dll extension=php_openssl.dll extension=php_pdo_mysql.dll extension=php_pdo_sqlite.dll extension=php_bcmath.dll extension=php_ctype.dll extension=php_dom.dll extension=php_hash.dll extension=php_iconv.dll extension=php_intl.dll extension=php_simplexml.dll extension=php_soap.dll extension=php_xsl.dll extension=php_zip.dll
Note: if any package is not available in your XAMPP installation, install it separately.
Step 9: Add C:\YOUR-XAMPP-FOLDER\php7** to your Windows system path, so that this version of PHP is available globally: Open the System Control Panel. Click ‘Advanced System Settings’. Click the ‘Environment Variables…’ button. Click on the Path row under ‘System variables’, and click ‘Edit…’ Click ‘New’ and add the row C:\YOUR-XAMPP-FOLDER\php7** or Edit existing one and set entry from existing C:\YOUR-XAMPP-FOLDER\php7** to new C:\YOUR-XAMPP-FOLDER\php7**
Click OK for "Edit environment variable window",
then click OK for "Environment Variables window",
then click OK for "System Properties window",
and close the System Control Panel.
Step 10: restart XAMPP.
check the PHP version using “php -v”.
Congratulations
Hopefully it will help someone. If you have any questions, please comment out.
Open your XAMPP server and start Apache and MySQL applications
Note: Composer is required for developers who wish to contribute to the Magento 2 codebase or anyone who wishes to develop Magento extensions and extend Magento project. Composer enables us to manage the Magento system, extensions, its dependencies, and also allows us to declare libraries for the project.
Note: Once composer is installed, we have to enable the extension (php_intl.dll) in our php.ini (php configuration) file. To enable the extension, open php.ini file (default path: C:\xampp\php\php.ini) and uncomment the line “extension=php_intl.dll” by just removing semicolon “;” from the starting of the line and restart XAMPP control panel (by clicking on stop and start button in “Actions” column).
Now, we will create a new folder in c: -> xampp -> htdocs folder (default path: C:\xampp\htdocs) (we have used folder name “mage”). Now go inside “mage” folder and extract Magento 2.3.1 files (which we have downloaded earlier from here) inside this folder.
Note: Magento 2.3 allows us to install the Magento software and extensions using either the Web Setup Wizard or the command line.
First, we have to create an empty database in our local phpmyadmin. Open any browser and go to http://localhost/phpmyadmin/ Then create a new Database. or we can create using following SQL:
CREATE SCHEMA `mage` DEFAULT CHARACTER SET utf8;
where “mage” is database name.
Way 1: Here we are going to use “Web Setup Wizard”.
To install the Magento software using the Setup Wizard:
Step 1: Start a web browser.
Step 2: Enter the following URL in the browser’s address or location bar:
http://<host or IP>/<path to Magento root>/setup
e.g. http://localhost/mage/setup or http://127.0.0.1/mage/setup
It will show you following screen:
Step 3:Now click on “Agree and Setup Magento” button.
Step 4: click on “Start Readiness Check” button.
NOTE: If configuration (PHP extension settins) is setup correct, then we will find following screen:
Otherwise we have to setup configuration properly again.
Step 5: Now click on “Next” button.
Step 6: Enter host, database-username, database-password, database-name, table-prefix (optional):
Now click on “Next” button.
Step 7: Enter web url for magento project (by default magento setup base url for us), we can choose some advance options also, as visible in below screen:
Now click on “Next” button.
Step 8: Now select store default Timezone, default Currency, default Language:
NOTE: We can select and deselect any 3rd party modules from “Advanced Modules Configurations”.
Now click on “Next” button.
Step 9: Now enter admin user’s info like username, email, password and confirm password:
Now click on “Next” button.
Step 10: If all goes correct, then we can find Install button:
Now click on “Install Now” button.
Success: If installation is successful, then Magento will show us following success screen, with encryption key and other details of our Magento project:
Way 2: Here we are going to use “Command Line”.
Note: Hold the Shift key and right click, and Select “Open PowerShell window here”. This will open PowerShell window on the location. Note: We can also use Windows Command Prompt or GIT Bash (if installed). Open GIT Bash or Windows Command Prompt and change location to folder (C:\xampp\htdocs\magento), where “magento” is our Magento project folder name.
php bin/magento setup:install --base-url="http://127.0.0.1/magento/" --db-host="127.0.0.1" --db-name="magento" --db-user="root" --admin-firstname="ADMIN" --admin-lastname="ADMIN" --admin-email="admin@domain.com" --admin-user="admin" --admin-password="admin123" --language="en_US" --currency="CAD" --timezone="America/Toronto" --use-rewrites="1" --backend-frontname="admin" --session-save="files"
/* if your database have password add: --db-password="password-here" */
to understand above commands, please visit this link.
In my command line, I used following command:<br>
php bin/magento setup:install < setup installation commad with following values:<br>
base-url => "http://127.0.0.1/magento/"<br>
db-host name => "127.0.0.1" <br>
db-name => "magento" <br>
db-user => "root" <br>
admin-firstname => "ADMIN" <br>
admin-lastname => "ADMIN" <br>
admin-email => "admin@domain.com" <br>
admin-user => "admin" <br>
admin-password => "admin123" <br>
language => "en_US" <br>
currency => "CAD" <br>
timezone => "America/Toronto" <br>
use-rewrites => "1" (1 means you use web server rewrites for generated links in the storefront and Admin)<br>
backend-frontname => "admin" <br>
session-save => "files" (to store session data in the file system)
If installation goes fine, we can find above success result in our Windows Command Prompt or GIT Bash window.
Congratulations
Magento 2.3.1 is successfully installed on our localhost. We can access localhost magento project using http://localhost/mage/ url in any web browser.