Monday, December 27, 2010

Hello World in PHP.

A php(Hypertext Processor) is a server-side Programming Language. Meaning, any program made in PHP can only run in a server machine. So, first thing you need to do is to have a server computer. Sounds hard right. But it is not. Now a days, there were several applications that can be used to make your computer a server computer. XAMPP and WAMP are some of those.

Ok, let's move on.

- in this case, i'm gonna choose xampp. if you are using linux you may use wampp..
(well anyway, you can use any of the two. But in my case i'm gonna choose xampp)

To download XAMPP Go to this link.
- http://www.apachefriends.org/en/xampp-windows.html

And here is how to install it.
- http://www.apachefriends.org/en/xampp-windows.html#522

Ok.,, Assuming that you hve already installed the xampp.
(A Brief info about xampp: It has already have PHP, and MySQL and Apache. In our case, in this tutorial, we just need the Apache.)

Open xampp and then activate the PHP and Apache.

Ok. when the XAMPP is installed. Goto to this directory on your disk drive
c:\xampp\htdocs\

-And then create a text file and name it myphpbasic and then save it as .PHP

and then once you have already created it.


open it through notepad.


and then type the following code.


<?php
          echo "Hello world!";
?>


and then open a web browser (firefox, opera, or google chrome)

and on the address bar, type this: http://localhost/myphpbasic.php


And you'll see the output.


//=================================
Sample Ouput:

Hello world!

//=================================

Thank you folks.

Hope you enjoyed reading my tutorial.

No comments:

Post a Comment