1 / 3
amogtech
2 / 3
mhk
3 / 3
ccg


We need Apache Service to run php codes. Now I hope you've already installed the Apache Service in your Windows PC. If you have not installed, please click here.

We need Text Editor to write php codes. If you don't have any text Editor, please click here.

If you've completed the above steps. We will start to write php codes.

 

1. Open your Text Editor (here I use ConText) and create New File.

2. Choose PHP instead of Text files as the below picture.

3. Save that file as test.php in the C > xampp > htdoc.

4. In test.php, write the following codes.

    <?php

    echo 'Welcome to TNW!';

     ?>

5. Save the file.

6. Open Web Browser and type localhost/test.php and press Enter. Then, you will see Welcome to TNW.

Now, We have successfully created first php file in Windows.


Share On: