The XAMPP welcome page. To have Apache serve your own web site content there are two main options. The first is to place it within the default DocumentRoot.The second is to place it outside of the default DocumentRoot and use the Alias directive to map a URL to this location. In the following examples, the generic index.php file below is placed within the DocumentRoot or aliased location. XAMPP and phpMyAdmin as localhost provides a local server for developers to test and build web apps. XAMPP is a local server that is installed on personal computers/laptops. It provides a local environment to create, run, and test PHP applications before deploying them on live servers. Follow the below steps to Change localhost to custom domain name in XAMP server 1) Open the file C:WindowsSystem32driversetc and edit “as Administrator” = hosts file. Add the below line and save the file. 127.0.0.1 phpcodez.com. To configure XAMPP server to send mail from localhost we have to make changes to two files sendmail.ini and php.ini. Open the xampp folder. By the name of “sendmail.ini” is present in sendmail file and “php.ini” is present in php file in the xampp folder.
20 Jul Run your first PHP program in XAMPP Server on localhost
Beginning with PHP is quite easy. If you’re a beginner, then this post is for you, and will make you feel comfortable in running PHPprogram on XAMPP Server. Begin developing your website on localhost, and then move forward and upload the website live, with a domain name and hosting account.
Let’s start with installing XAMPP, and running first PHP program using XAMPP Server on localhost. Following are the steps:
- Download and Install XAMPP
- Create a new project in XAMPP and add your PHP program
- Open XAMPP and run your first PHP program
Download and Install XAMPP
Step 1: Go to the Apache Friends website and download XAMPP Server. Apache Friends is the official website to download XAMPP:
Step 2: After downloading, install it.
You can install it at any location. We installed XAMPP ic C: drive,
Create a new project in XAMPP
Step 3: Now, go to htdocs folder in Xampp folder and create your project folder.
Here, a folder AmitProject created, as in the below screenshot:
Step 4: Now, create a file with .php extension. We have created a file with name, FirstProgram.php.
Add the following code in it,
Open XAMPP and run your first PHP program
Step 5: Go to start button, and type Xampp Server to open it.
This will open Xampp Server- Control Panel. After opening it, just click Start on Apache to start the server:
Step 6: Now, go to the Web Browser and type, localhost/AmitProject and press enter.
On pressing enter, you can see the following, locate your PHP file FirstProgram.php and click on it:
Step 7: Just press enter in the address bar,and you can see the output of your first PHP program FirstProgram.php:
Xampp Php Not Working
We saw how to run a PHP program using XAMPP Server on localhost. A step by step process to create a new PHP program file and run it to get the output.
Here’s the video, explaining the steps shown above, Eve echoes and eve online.
Note: You do not have to START Apache Server again and again. But, yes, if you “shut down” and “restart” your system, then there is a need of starting the server again.
Hope you liked the tutorial, kindly share it with others.
Xampp Run Php File
If you have any query, then please mention in the comments section below.
How To Use Xampp Php
Mysql Xampp Localhost
- Attempt Online PHP Quiz