How to Change Virtual Host

Untitled Document.md
  1. Create PHP Project Folder inside Drive D exmaple: I create it in D:/Project
  2. than Create index.php
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Hello World</title>
    </head>
    <body>
        <h1><?php echo "Hello World"; ?></h1>
    </body>
</html>
  1. Open XAMPP
  2. Click Config then click Apache (httpd.conf) and Search for DocumentRoot than you will see
DocumentRoot "C:\xampp\htdocs"
<Directory "C:\xampp\htdocs">
  1. then Replace it to your Directory of your Project Location
DocumentRoot "D:/Project"
<Directory "D:/Project">
  1. Restart your XAMPP server than run localhost or 127.0.0.1 will see your Hello World

To custom Domain Name go to How to Change Domain Name on XAMPP From localhost or 127.0.0.1 to yourdomain.com

if you like this turtorial just Leave a Comment :) Thanks

បង្ហាញមតិយោបល់

អត្ថបទមុន អត្ថបទបន្ទាប់