Instructions for installing localhost with XAMPP

Tram Ho

The localhost concept, the importance and the quick and easy guide to install localhost on your computer. When starting to learn PHP, we need to use localhost to run PHP files on our machine. So what is localhost? Why must install localhost on the computer to run PHP files?

What is Localhost?

Localhost simply understands it as the server that is operated on your machine. Since PHP is a server-based scripting language, it requires a server to be able to run it.

Localhost includes many applications bundled together:

  • The webserver is named Apache.
  • PHP software for handling PHP code.
  • MySQL Server for storing and processing databases.
  • PHPMyAdmin for viewing and managing MySQL databases.

Principle of operation of Localhost

After installing localhost, your computer will have a Webserver to run the web application at http://127.0.0.1 or you can run it from http: // localhost .

Every time you need to use you open the control panel of localhost and activate the launch of the attached applications.

Instructions for installing Localhost with XAMPP

There are many ways to install localhost but for this article we will install localhost with XAMPP for a few reasons:

  • XAMPP is free.
  • Easy to use.
  • Supports Windows, Linux, Mac operating systems.

And this article we will only install with Windows only.

First, go to the following link to download XAMPP https://www.apachefriends.org/download.html choose the version suitable for your device. XAMPP only has 32bit version but 64bit is still used normally.

After downloading run the file, then Next.

Go to the section to select the XAMPP installation path, you can leave it as default or put it in the drive you like but remember this path, then next and next.

After the installation is complete, press the Finish button to finish the installation and display the control panel.

Start localhost in XAMPP

Now go to the folder where the XAMPP settings are saved above, for example c: xampp open the xampp-control.exe file to launch the XAMPP control panel.

Click the start button of the Apache and MySQL applications to start the Apache Webserver and MySQL Server.

If both display the word stop and there is no message, then it is successful. Access to http: // localhost will see XAMPP’s introduction page.

If there is an error that cannot start either of the above applications, you can go to the apache error correction guide to see the error correction guide.

summary

So we have learned about localhost and how to install localhost with XAMPP already, hope this article will be of great help for you. From the next post we will learn more about PHP, hoping for everyone’s support.

Share the news now

Source : Viblo