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.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).
XAMPP is a completely free, easy to install Apache distribution.
- In the web browser, visit Apache Friends and download XAMPP installer.
- click on the required version and bit on your system download and install.
- Uncheck the Learn more about bitnami option and click Next button.
- 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.
- 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.
<?php $conn = mysqli_connect("localhost","root",""); ?>
<?php $localhost='localhost'; $root='root'; $pass=''; mysqli_connect($localhost,$root,$pass); ?>
If you are using database here are the connections.
- click on xampp and start Apache and MySQL.
- open the htdocs folder. You can find it under the XAMPP folder in your local disk (C: or D:) or any local disk name on your sysytem. In this htdocs folder, we will create a new folder named our database 'First' to store our web files. XAMPP will use this 'First' folder to execute and run the PHP web pages or website.
- Type >localhost/PHPMyAdmin in your browser and click on New.
- Create a database name(let name the database as db_name).
- Create Connection
<?php $conn = mysqli_connect("localhost","root","","db_name"); ?>
<?php $localhost='localhost'; $root='root'; $pass=''; $db_name='db_name'; mysqli_connect($localhost,$root,$pass,$db_name); ?>