Install XAMPP

Admin   PHP   354  2020-12-30 23:42:20

What is XAMPP?

Xampp is a Web server creator with built-in Apache, PHP, MySQL, FTP Server, Mail Server, phpMyAdmin, and tools like phpMyAdmin. Unlike Appserv, Xampp has a quite convenient management program, allowing to proactively turn on / off or restart server services at any time.

Download XAMPP

Select the appropriate version and download it directly from the XAMPP main page: https://www.apachefriends.org/download.html

Install XAMPP

Question

  • Download and install the file, for example: xampp-win32-5.6.24-1-VC11-installer.exe
  • Double click the downloaded file (or run as administrator by right-clicking on the downloaded file> Run as administrator), if your computer has a virus browser, a dialog box "Question" will appear, no need to worry, just choose "Yes":

install xampp

Warning

  • Immediately followed by a dialog box "Warning" about the User control, if you run as administrator, you do not need to pay attention to this warning, select "Ok" to continue, if you want to be more secure, you just choose to install. XAMPP is in a drive other than the one where Windows is installed (select the drive in the Setup - Installation folder step).

install xampp

Setup - XAMPP

  • Welcome screen of setup then click "Next"

Setup - Select Components

  • At this screen select the applications attached to the XAMPP suite, you can remove the unnecessary parts, but just select all and "Next", because you will have the opportunity to use it later.

install xampp

Setup - Installation folder

  • Select the directory to install, containing the XAMPP directory, usually leave C:\xampp as default.

install xampp

Setup - Bitnami for XAMPP

  • About the Bitnami integrator for XAMPP, if you want to see an introduction, click on "Learn more about Bitnami for XAMPP", otherwise uncheck it.

install xampp

Setup - Ready to Install

  • The preliminary preparation steps are complete, now click "Next" to install.

install xampp

Setup - Welcome to XAMPP!

  • Here is the installation screen, just wait until it is finished to be able to use XAMPP.

install xampp

Start Apache and MySQL

Installation is complete

  • Here is the first interface after successful XAMPP installation.
  • Under "Actions" click on the 2 "Start" buttons of "Apache" and "MySQL" respectively to launch the two applications.

install xampp

Error correction

  • Normally, when the installation is completed, it is easy to get an error that cannot start Apache, the most common cause is due to the port 80 conflict, this port has many priority programs running, such as Skype, IIS, World Wide Web Publishing Service, HTTP Server API, ...
  • The workaround is to shut down the above programs and then restart Apache.
    • Skype, IIS, or HTTP Server API, ... close the corresponding application.
    • World Wide Web Publishing service, press the key combination: Window + R> type services.msc > look in the dialog box that appears "World Wide Web Publishing Service"> right click and choose "Stop".
  • After shutting down the corresponding application, click "Start" to restart Apache, the screen shown below is successful.
  • Type on the browser http://localhost if the word "It works!" (or display the Xampp dashboard), you have successfully installed.

install xampp

phpMyAdmin

  • phpMyAdmin is already built into the Xampp installer, so when Xampp is installed, you can use phpMyAdmin.
  • Click on the "Admin" button corresponding to "MySQL" to open the phpMyAdmin page

install xampp

Working directory

  • The operating directory from here on is C:\xampp\htdocs
  • For example, you have a project contained in a folder called "myproject", copy this folder to the working directory on XAMPP, we have C:\xampp\htdocs\myproject\
  • To run the files in this project, you need to type in the browser http://localhost/myproject / then if there is no index file, the files or folders inside will be listed fully.
  • Continue to try to create the file hello-world.php with the content inside is the PHP code
<?php

echo "Hello World!";

?>
  • Then type on the browser http: //localhost/myproject/hello-world.php we will see the results as below:

Hello World!

Theo Học Web chuẩn.