Right let’s have a crack at some php then, all you need to make a php file is Notepad or any text editor for that matter.
So, let us open up notepad… as I make up code etc it will be added to the live version of this site. So if you are visiting when I have got good at PHP then it will please you to know that this site was once a bunch of html pages.
Enough of this gay banter, let us get started…
The first characters you should include in your php file is a <? opening tag and an ?> closing tag. So any code between these markers will be executed as php code. as long as your file extension is .php
Ok, to get on with some PHP we need to download the engine, what is that…? well…the php engine is something that you install to your machine that allows IIS to process PHP pages. When initially installed IIS will only run certain types of pages, these include .htm, .html (these are both the same) and .asp(Active Server Pages).
Active Server Pages are a Microsoft technology so naturally Microsoft made IIS able to process .asp files. HTML is what is called an open standard and has been around for ages, and is an industry standard language(default if you like) for writing webpages so it would not be very practical if IIS web server did not run HTML pages(see w3c.org for more info)
So in order to make IIS run PHP pages you need what is called a plugin, or more precisley a script engine.
So how/where do you get the PHP script engine?
Simple, navigate (open a browser and go to…) to www.php.net and you can download it from there. I am not going to go into much detail about downloading the php engine as i am assuming you all know how to download files and use the web to a basic level. I will recommend one thing though. Download a Windows Binary (i am assuming you are using windows) and get an installer they are clearly labelled on the PHP site, also i recommend version 4.3 and above…at the time of writing they were the most stable versions.
After your files Downoads
Once the file has downloaded, find it on your hard drive and open it, it should(if you got the windows installer) take you through an installation wizard, all being well. Now its pretty straight forward, keep pressing next. You will get a couple of options about a mail server, leave those as they are, and then something about the IIS version. Now, to be on the safe side. set it to version 4.
If everything went well then you can move on…to getting started with PHP part 3!
So, Getting started with PHP huh? now you may have noticed that this site, was all made from .htm files. You are right in thinking that I made it entirley in HTML. The reason for this is simple, because I didn’t know any back then! Plus there are also some things we need to do before we start coding PHP.
The Following set of tutorials details how to set up your PC to start writing PHP scripts!
Right if you are the average windows user you will probably be supprised, like i was, to know that you can turn your PC into a web server for your own personal use, and if your on a network, others will be able to see your pages once you’ve made some.
So how do we do this?
Setting up Internet Information Services on Windows XP
OK, to start with, from your desktop, click the start button, settings, control panel.
In the control panel, select “Add/Remove Programs” and Click Windows Setup or add/remove windows Components
Add/Remove Components in the Control Panel – This is to make windows take a look at what snap-ins are currently installed on your machine.
A list of programs should appear, ones with ticks next to them are installed, ones without are missing.
Scroll down and put a tick next to Internet Information Services(IIS) and press next. Windows then does some jiggery pokery and installs IIS or the web server bit to me and you. Please note this is for XP pro users only and you will need your windows disk for this bit.
Boring Part 1 over – Lets get the things needed to do some PHP with!
You’ll need to check out Getting Started with PHP pt 2 for that!