Nov 25

Here I will show how to start php programming. Lot of my friends like php, but there is a starting trouble. This will help you to write your first php program.

You need to install LAMP (Linux Apache, Mysql, PHP )Server.
Click Here How to install LAMP Sever in Ubuntu Linux

Now you can check your Apache webserver

Open a browser (firefox) and type http:// 127.0.0.1 in address bar

It Shows ” It Works

Now you can test your PHP

See your server root is pointed to the folder /var/www by default. So you have to save your programs in /var/www. But There is a problem, you can’t write in to the folder /var/www as ordinary user, it needs root privilege . (I am using gksu for solving this proble, it will ask for your sudo password)

open a terminal type the following

$cd /var/www

$ gksu gedit helloworld.php

write the program

<?php  echo "hello world";?> 

now save and quit

open browser (firefox)

type the following in the address bar
http://127.0.0.1/helloworld.php

Now You will get the result in the browser

” hello world”

Now your First PHP program is Working

write valuable comments for helping php beginners

2 Responses to “How to start PHP Programming. Write your First Program in PHP”

  1. ammu Says:

    thanks a lot..
    very useful basic step for creating php file….
    was hitting my head for past one week.. great help for beginners…

  2. ammu Says:

    was hitting the head for creating php file and surfed net for past one week all in vain….
    its great help for beginners and thanks for it…