XAMPP is the most popular software package which is used to set up a PHP development environment for web services by providing all the required software components. During the process of software deployment, most of the web servers use almost similar components, so use of XAMPP provides easy transition from local server to live server. XAMPP is a AMP stack which stands for Cross platform, Apache, MySQL, PHP, perl with some additional administrative software tools such as PHPMyAdmin (for database access), FileZilla FTP server, Mercury mail server and JSP Tomcat server.
Other commonly known software packages like XAMPP are WAMP, LAMP, and others.
The XAMPP server is used to test PHP pages. It works as local server. It contains a MySQL database to manage or save data on a local server.
Advantages of XAMPP:
- It is free and easy to use and easily available for Windows, Linux and Mac OS .
- It is a beginners friendly solution package for full stack web development.
- It is a open source software package which gives a easy installation experience.
- It is very simple and lightweight to create set up for development, testing and deployment.
- It is a time-saver and provides several ways for managing configuration changes.
- It handles many administrative tasks like checking the status and security.
Software components of XAMPP:
- Apache plays the role of processing the HTTP request. It is the actual default web server application. It is the most popular web servers maintained by Apache Software Foundation.
- MySQL The role of database management system in XAMPP is played by MySQL. It helps to store and manage collected data very efficiently. It is an open-source and most popular.
- PHP is the server-side scripting language which stand for Hypertext Preprocessor. It is embedded with HTML code which interacts with the webserver. It is an open-source and work well with MySQL and has become a common choice for web developers.
- Perl is the high-level programming language designed for text editing which serves purpose like web development and network programming.
Steps to install XAMPP on Windows:
- In the web browser, visit Apache Friends and download XAMPP installer.
- During the installation process, select the required components like MySQL, FileZilla ftp server, PHP, phpMyAdmin or leave the default options and click the Next button.
- Uncheck the Learn more about bitnami option and click Next button.
- Choose the root directory path to set up the htdocs folder for our applications. For example ‘C:\xampp’.
- Click the Allow access button to allow the XAMPP modules from the Windows firewall.
- After the installation process, click the Finish button of the XAMPP Setup wizard.
- Now the XAMPP icon is clearly visible on the right side of start menu. Show or Hide can be set by using the control panel by clicking on the icon.
- To start Apache and MySql, just click on the Start button on the control panel.
Note: Suppose Apache is not starting, it means some other service is running at port 80. In this case, stop the other service temporarily and restart it.
Making server request: Open your web browser and check whether the XAMPP service has properly installed or not. Type in the URL: http://localhost. If you are able to see the default page for XAMPP, you have successfully installed your XAMPP Server.
To Check if PHP is Working: All the website realted files are organized in a folder called htdocs and then run index.php file by using http://localhost/index.php or http://localhost.
Note: For every new website or application, its always better to create a different folder inside htdocs, to keep it organized and avoid confusion.
For example, if we create a folder geeksforgeeks and then create a file nameed as ‘helloWorld.php’. All the contents related to it are put inside the folder ‘geeksforgeeks’. So the root ‘URL’ of the website will be ‘http://localhost/geeksforgeeks/’. So any home page is accessed by typing the root URL in the browser. To see the output, just type ‘http://localhost/geeksforgeeks/helloWorld.php’.
Generally web servers look for index file (landing page) namely index.html or index.php in the root of the website folder. Go to /xampp/htdocs/ folder and create a file with .php extension (test.php) and type or copy the below code and save it.
Now open your browser and go to “http://localhost/test.php” if you see the
page same as below then PHP has successfully installed.
Note: In XAMPP, the configuration files of Apache, MySQL, PHP are located in C:\Program Files\xampp. For any configuration file changes, you need to restart Apache and MySQL.
- How to configure XAMPP to send mail from localhost using PHP ?
- How to install the previous version of node.js and npm ?
- How to install Apache server in Ubuntu ?
- How to enable PHP's openssl extension to install Composer ?
- How to Install php-curl in Ubuntu ?
- Why Linux Hosting is Cheaper than Windows Hosting ?
- How to set PHP development environment in windows ?
- How to set the width and height of an image using HTML ?
- Domain Resolution and URL Processing
- How to open a different modal that is inside of a list ?
- Signup form using PHP and MySQL Database
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.