Friday, July 5, 2013

Lesson 1: Hello world !

Let's step into the pool and start to swim........ 


  1. First you need to install apache 2 server and PHP in your operating system . There are many executable files that can install this in your workstation.
  2. Make sure you are running apache server .
    • try 'localhost' (without quotes ) in your browser. If it shows a page then you are fine. Else there is something wrong with the installation.
  3. Make sure you have a text editor. For windows I would suggest Notepad++ .
  4. Go into the servers public_html folder. For Wamp/linux systems this can be www folder.
      • Ex : C:/wamp/www , C:/ xampp/htdocs
      • Ex:  /srv/www/public_html
  5. Open a new file in the servers default folder you just found in step 4 , and save it as hello_world.php.
  6. Type the following text into it.
  7. <?php  echo 'Hello World !' ?>
  8. And go to your browser and type' localhost/hello_world.php '. And this will show Hello World in the browser.

Explanation:

  1. '<?php ' is opening tag and '?>' is closing tab of php. Compiler will only look into the codes between these tags.
  2. 'echo' means print this . 

1 comment: