You are here
Home > Php > Hello World in PHP

Hello World in PHP

Hello Friends, Today I am gonna make Hello World Program in PHP but before that we will setup WebServer. WebServer is needed because PHP not work without WebServer. WebServer parses PHP script into text/html and then sends this parsed response to client’s browser.

Setup WebServer

  1. Download WAMP from here (You can download XAMPP also or other web server you want).
  2. Now start installing procedure by double clicking on downloaded exe file and follow the steps which comes during installation.
  3. After completion of installation procedure find www folder in case of WAMP or htdocs folder in case of XAMPP, which would be basically C:/wamp/www or C:/xampp/htdocs in case of XAMPP.
    (www or htdocs is the working directory where we put all our php, html, etc files)
  4. Now start server from start menu.
  5. Now open your browser and type localhost in address bar, if the server is running then you will see homepage of server. If server’s homepage not shown then make sure that server is installed correctly and running.

First Program

  1. Open notepad or any of your favorite text editor.
  2. Type or Copy the below code into the text editor.
  3. Save file in www folder in case of WAMP server or in htdocs folder in case of XAMPP server and give it name test.php
  4. Now open your browser and type localhost/test.php in address bar of browser and press enter. And its done you have output of first program Hello World.

Output

Hello World

 

Thanks

You may share if you like it

Rajesh Kumar Sahanee
I am a passionate Java Developer and I like Computer Programming. I love to do some interesting experiments and listening music in my free time.
https://www.zatackcoder.com

Comments

zatackcoder
Top