To develop a website using PHP we will require the following software packages:

  1. Wamp server
  2. Editor

Wamp Server:

To develop and test website we need one server. We can either use wamp or xamp server for the same purpose. No matter which of these you use, both offer same working mechanism. If you don’t have one, you can download wamp from its official website. Select either 32bit or 64bit version depending on your machine.

After downloading click on the setup file and follow the steps to install it. After successful installation we need to test if server is running properly. To check the wamp server click on the wamp taskbar icon and select start all services.

start wamp start

If services are started successfully, wamp icon will turn to green.
Now open browser and type http://localhost in to the address bar or click on the wamp icon located on taskbar and select localhost.

localhost

If everything is OK, it will show home page of the wamp server as shown below.

wamp serverhome page

wamp serverhome page

Now create a new folder to store our project file under the directory of www of the wamp server installation directory. Usually it might look like C:\wamp\www\DreamMaker where DreamMaker is the name of our newly created project folder. It might differ if you have given different name. And that’s it. Now we are ready to go!

Editor:

To create PHP web pages we can use any standard editors such as Dreamweaver or notepad.

One advantage of using standard editor such as Dreamweaver is that it provides auto code completion and intellysense about syntax so we need not to bother about syntax at all.

If you don’t have it, then also doesn’t matter. We can also use any standard text editor such as notepad to develop PHP web pages. Open notepad and write the following code:

              <?php        echo “welcome to DreamMaker!”;   ?>

Remember every php web page starts with “<?php” and closes by “?>” tag. They define starting and ending of phpweb page respectively.

echo statement is similar to the printf function of C language if you are familiar with C.In fact we can also use printf functions itself for better formatted printing. echo simply prints the content on the web page as a string enclosed within the double quote. Writing the string content inside double quote is not necessary. We can also single quote as follow:

                           echo ‘Welcome to DreamMaker’ ;

It will produce the same output as before. Each php statement ends with semicolon (“;”). It specifies ending of the php statement or instruction similar to the C and C++.

Now save your file with save as option inside the folder we have just created under www root directory. Save with any valid name you like with php extension such as “HelloWord.php” or something like that.

Now make sure that your server is running. Now type http://localhost into your browser’s addressbar.

It will show the home page of the wamp server. Under “Your Project” title it you will see our project folder “DreamMaker” we had created before. Click on that and it will list available files. In our case HelloWord.php.

Click on HelloWord.php file to run it. It will display welcome message “Welcome to DreamMaker” inside the browser.