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
** Please check the documentation on the php website if you are having problems with installation. Or email me and i’ll be glad to help out.
To open up IIS and see what I’ve been banging on about you will need to go to Control Panel – Administrative Tools – Internet Information Services(IIS).
** I recommend making a short cut to this on your desktop.
OK when you first open IIS it should look something like this(Once you have expanded all the branches to the Default Website Level)
The to create a virtual directory, Right Click on the Default Web Site and go to ‘new’ – ‘Virtual Directory’.
Once to this stage we’ll move on to a new page.
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!