Category Archives: Dates and Times

Getting Started with PHP part 4

** 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)

Internet Information Services - Default View

The to create a virtual directory, Right Click on the Default Web Site and go to ‘new’ – ‘Virtual Directory’.

Internet Information Services - Virtual Directory

Once to this stage we’ll move on to a new page.

Getting Started with PHP part 3

Now we’re ready to start putting some of this stuff to use!

OK now we have installed IIS (the server) and the PHP script engine to help IIS to run our PHP files. We need somewhere to put them. This is where IIS comes in. We need to create a virtual directory, if like me your inital thought was whats all that mean then? I’ll try and explain

Right well the easiest way to tell you about these is by example. Us Brits see virtual directories everytime we watch the BBC. They are always advertising their website e.g. bbc.co.uk/nature or bbc.co.uk/sport. Now the bit on the end is the virtual directory, the /sport or /nature the bbc.co.uk is the domain name of the BBC. When we type in bbc.co.uk/sport the browser will check with IIS and IIS will do 1 of 3 things:

redirect you to another URL (website)
redirect you to another directory somewhere on a network
redirect you to a directory on your local computer
So, what does this mean…?
It means that when you type in bbc.co.uk/sport IIS looks at where that location points to (out of the above list) and takes the appropriate action, so if you have a directory or folder full of HTML files and you point IIS to look at that folder, when someone enters the name of your virtual directory IIS will go to that directory on your computer and pull out the file named either “index.htm” or “default.htm” or which ever file you specify.

So an example to make this a little clearer, you have a folder c:\yourvirtaldirectory and a virtual directory called /yourvirtualdirectory. in that local folder you have an index.htm page. When you type in http://localhost/yourvirtualdirectory (providing it has been set up correctly which we will do next), IIS should pull out your default document

e.g. http://yourcomputername/your-virtual-directoryname will point to c:\yourvirtualdirectory and vice versa.
This should become clearer once you’ve read getting started with PHP part 4.

Getting Started with PHP # 2

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!