In this quick article, we will discuss where to place PHP files in XAMPP and how to access them from the browser.
Install XAMPP
If you haven't installed XAMPP then use the below link to download and install the same:
https://www.apachefriends.org/download.html
Where to Place PHP Files in XAMPP?
The main directory for all WWW documents is \xampp\htdocs.
C:\xampp\htdocs
How to Access PHP Files from Browser
Let's create a simple PHP script file "test.php" with the following code into it:
<!DOCTYPE html>
<html>
<body>
<h1>My first PHP page</h1>
<?php
echo "Hello World!";
?>
</body>
</html>
Keep the above "test.php" file within "C:\xampp\htdocs" location:If you want to create a new folder "new" within "C:\xampp\htdocs" and keep all the PHP files then you need to those files using the below URL in a browser:
Comments
Post a Comment