PHPBuilder - The ABC's of PHP II - What do I need to make it work? Page 2

RSS Twitter

The ABC's of PHP II - What do I need to make it work? - Page 2

by: Peter Shaw
March 26, 2009

Installing PHP under Windows

To install the IIS web-server under Windows, you'll need your original Windows install disk, you'll also need the professional version of your chosen Windows, if you have home, standard or something similar then you'll have to download the Windows version of apache from the apache website and install that. Go into your windows control panel, then open 'Add remove programs' click on 'Add/remove Windows components' on the side menu, then from the dialog that opens select 'IIS Internet information services' and click next. Follow any further instructions.
If you had to install Apache2 for windows then this will have been just as easy, by simply answering the questions and clicking next.
Please remember to read all dialog boxes fully, especially any that tell you where the root of your file system is.
Once you have your web-server installed, go to and download the Windows binaries for PHP and click on the downloaded file to install.
Testing the installation
If everything has gone ok, find the root folder for your web server. Under linux this will be something such as '/var/srv' or '/usr/share/httpd/' or 'c:\inetpub' depending on your installation platform, again I can't tell you exactly where to look because this will be different depending on your chosen install. One thing I will say, is there is a chance that there may be an 'index.html' or 'Default.htm' in there somewhere which will help you decide if it's your web server root directory.
Once you find this location, create a simple file called 'mytest.php' or 'testfile.php' and put the following lines in it:


Save your file then try to run it using http://localhost/mytest.php (or whatever file name you chose) and if all goes well you should see the default php information file.
A word of warning on choice of file name, it's very very ill advised to call the file phpinfo.php or phptest.php Automated cracking tools used by script kiddie's will very often look for files like this to try and determine details about a given server prior to attacking it further. A good rule of thumb to follow is that if the file name is a common one, and easily guessed then chances are there's a script out there somewhere to find it.
In this article we looked at installing a web server and PHP so you can start creating PHP scripts, I only wish I could have been more specific in a lot of cases, but because of the immense number of differences it's a very tricky thing to do.
There are many pre made LAMP & WAMP packages that will automate a lot of this stuff for you, and it is highly recommended you use those. Manually installing this stuff is not for the feint hearted and as long as I've been doing this, the average Apache config file still gives even me nightmares at times.
In the next article, we'll get stuck into some PHP properly.
Until then
Happy PHPing
The ABC's of PHP Series

« Previous Page

Comment and Contribute

Your comment has been submitted and is pending approval.

Peter Shaw



(Maximum characters: 1200). You have characters left.