PHP differs in that it is a ‘server-side’ script – that is, it must be processed by a server (such as Apache) and cannot be processed by your web browser.
‘But when I go to some websites, the address is mywebpage.com/index.php – how can that be?’
The .php extension is used to remind the server that there is information inside this webpage that it must process before sending it to your web browser. By the time this code makes it to your screen, the server has turned it into things like HTML and CSS that the web browser can understand.
This makes it very difficult to build and test PHP scripts on your personal computer – since your browser cannot handle it, you would have to create your script, upload it to a server and then access it through a url. Unfortunately, in a testing environment where you will be making changes and testing a script a hundred times before it is done, this isn’t realistic.
WampServer allows you to easily set up a server on your home computer, meaning you can turn your computer into a ‘server’ and process your scripts locally! It literally means ‘Windows Apache MySQL PHP’. WampServer only runs on Windows machines and installs Apache (the server) and both PHP and MySQL, which you will use to create and run your scripts. It also includes phpMyAdmin and SQLiteManager, which we will discuss in future articles.
WampServer is free and the first thing we’ll need to do is get the installation package. You can do that by accessing the following link:
Get WampServer (would link here - http://sourceforge.net/projects/wampserver/)
When you click “Download”, you will have a list of files to choose from. Select ‘WampServer 2’ and Save.
Before we do anything else, access your Control Panel and click on “Add/Remove Programs”. Since we cannot install two versions of WampServer on the same machine, we will have to ensure that no previous versions of WampServer are installed on your machine.
Once you have downloaded the package, double click to begin installation. You will see an introduction screen. Click Next and read through the license. When you are ready, choose to accept it and proceed with the installation.
As you proceed, WampServer will ask you where you would like to install. The default will be something like ‘c:/wamp’ and, although you could technically install this package anywhere you wanted, it is best to keep the default – for all ensuing WampServer articles we write, we will be giving instructions as if this is where the server is, so to keep things simple as you work through this series, it is better to use the default.
From here, you will be asked three additional questions – whether or not you’d like to create Desktop or Quick Launch icons for WampServer (totally up to you) and then a question on your default browser, and another question on your mail settings. If you do not already have in mind alternatives for these things, it, again, is best to use the default settings.
You’re Done!! WampServer has been successfully installed. At this point, it is crucial to remember if your computer asks you about access for this program, you must select ‘Give Access Always…’ or ‘Grant Always…’ or whatever language your computer uses, since this will ensure that WampServer will be able to function correctly.
Now that you’ve got WampServer installed, you should see a little odometer-looking icon in the system tray at the bottom right of your screen, near the clock.
Give that icon a left click, select ‘Put Online’ and WampServer is ready to go! In future articles, we will go into more depth on using WampServer to help you better understand localhost, set up a database and put your new server to use.