When I started writing these tutorials, I completely omitted the fact that you’ll need a web server running PHP to see the result of the code I’ve been providing. My bad!
Fortunately there’s a dead simple way to get going without any real knowledge of servers or hosting packages. Let’s get started.
First we’re going to head over to download WAMPServer. The download should start shortly.
It’s a farily large download, so it may take a few minutes for you to get the installer downloaded.
The installer doesn’t require any input from you while you’re installing it so simply click through the different steps of the installer until it begins installing the software, and then just let it do its thing.
The installer will ask you if you want to use a different browser than Internet Explorer this is up to you. If you select yes, you will have to point it to the browser you want it to use as the default. If you select no, it will use Internet Explorer as the default browser. The same will be asked of you for notepad. You can select NO for both options as they are not really important.
Now you should have WAMP server installed. You can click start and run WAMPServer. You should see an icon in the lower right hand corner of your screen like the screen shot below.
Finally we can test that our server is up and running by visiting LocalHost at (http://localhost). You should be presented with the page below.
Now we are going to go into our WAMP www folder and empty it out.
Remove everything in this folder. From now on, any PHP file we create, we will save in this directory. Once saved there, you can access the file by visiting http://localhost/NameOfFile.php
I’ve copied our lessons into my www folder and now if I visit http://localhost/Lesson2.php I can now see the result of our PHP Math.
As always if things don’t go as planned or you have any questions, please leave a comment and we will get you sorted out!
Until next time!