How to run an application in xampp local web server

  1. Previous
  2. Next
  3. Recent

    1. Signs 'He' May be Cheating on You
    2. 7 Vows of Hindu Marriage - Know What 'Saat Vachans' Mean
    3. RuPay vs Visa vs Mastercard vs American Express- A Comparison
    4. What is RuPay? Everything You Need to Know About India's Domestic Payment System!
    5. Top 10 Online Portals to Find a High Paying Job in India
    6. Top Indians who Revolutionized the IT Sector in India
    7. 8 Initiatives by Narendra Modi that Could Change the Future of the Nation
    8. 8 Work-from-home Jobs for Housewives, Students, and Part timers
    9. Complete Company Registration Process in India - Explained
    10. Change Name in India in 5 Steps - Filing Affidavit, Newspaper Ad & Gazette Notification

Once you’ve downloaded and installed XAMPP onto your computers, its time to write a web application to run on it.

Here is a simple PHP code, that’ll be executed by our XAMPP localhost,

echo ‘This is my first code that’s running on a XAMPP server’;

Copy the code and save to a file, say myfirst.php

[Being a PHP code, it requires a server to execute. If you try and run it like a simple .htm/.html file then it won’t execute correctly. PHP files are only executed on the server.]

Move this file inside the htdocs folder of your installed XAMPP folder. The folder location should be in D://xampp/htdocs.

Execute the code

To run this file, first start the server either directly from desktop or by starting xampp_start.exe inside XAMPP folder.

Once the server starts, open web browser and enter the url localhost/myfirst.php

Your PHP code should get executed.

application code executed in xampp local web server

Note: If myfirst.php is put under a folder named mf in htdocs then the url should be localhost/mf/myfirst.php

blog comments powered by Disqus