Red Eye Media
home services portfolio supportcontact
  Support

Visit Shop Maker
Red Eye Media
Shop Maker System

Installing Apache, MySQL & PHP on Windows 2000


<< Back

This tutorial explains how to set up your Windows 2000 OS to run Apache web server, MySQL database and PHP scripting language.
This is a basic tutorial ideal for a development enviroment, not a hardened, commercial install. Included in this tutorial are files to use, that will save you time and get your server running quickly. Download QuickSetup.zip before you start.


I would suggest that you print this document, as you will need to re-boot your system, which obviously means closing this tutorial.
I would also suggest that you uncheck the Hide file extensions in the view tab of the Explorers windows Folder Options since this prevents you from seeing the full name of files.


Download

Download the latest stable version of Apache from: http://apache.org
Download the latest stable version of MySQL from: http://mysql.com
Download the latest stable version of PHP from: http://php.net


Apache web server

Install Apache by clicking the setup file.
You will be asked to fill in the server name, domain name and admin email address. These fields are used for server error messages etc. You can put anything you like in these fields because this is only a development setup.
To start the server, you simply go: Start > Programs > Apache httpd Server > Control Apache Server > Start
To stop the server you simply go: Start > Programs > Apache httpd Server > Control Apache Server > Stop
Close it down for now.


MySQL database

Install MySQL by clicking the setup file.
Once installed, Go to C:\mysql\bin\mysqladmin.exe.
This is used to start / stop the MySQL server. I suggest you put a shortcut to this file on your desktop.
The first time you run this file, you will be prompted for a username and password. Remember these because you will need them when coding in PHP.
When the server is running, you will see a traffic lights icon in your system tray showing green lights when the server is running and red lights when it is not.
You will also find that the standard install puts MySQL in your startup, so it automatically starts at boot. To remove this go: Start > Programs > StartUp, find it and delete it.


PHP installation and configuration

Create the folder C:\php
Unzip your PHP files to C:\php\
Copy C:\php\php4ts.dll to C:\WINNT\System32\
Copy all DLL files from C:\php\dlls\ to C:\WINNT\System32\
You now need to configure your php.ini file. A configured version is included in our QuickSetup.zip
Copy it to C:\php\. You can now skip the next section.

Skip if you used the above php.ini file
If you want to edit your own php.ini file, open C:\php\php.ini-dist in Notepad.
Find the line that says extension_dir =
Make this line read extension_dir = C:\php\extensions;
Find the line that says ;extension=php_gd.dll
Remove the semi-colon from the beginning of this line. By removing the semi-colons from this section,
you are telling PHP which extensions to load, in this case, GD is a graphic handling extension
which can be used to create images.
Tip: When using Notepad, it likes to put .txt extension on saved files. To stop this remember to
select All Files from Save as type drop down in the save dialog, then save your file with the extension
on the end, eg: phpinfo.php


Configure your Registry

You now need to configure your registry. A RegScript.reg is included in our QuickSetup.zip
Execute this script.
Make sure you have printed this document and re-boot your system. You can now skip the next section.

Skip if you used the above RegScript.reg file
If you want to write your own RegScript.reg open Notepad and type:

REGEDIT4

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map]
".php"="C:\\php\\sapi\\php4isapi.dll"


Save this file as RegScript.reg and execute it.
Make sure you have printed this document and re-boot your system.


Check the registry

Go: Start > Run and type: regedit.
Go: HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Services > w3svc > parameters > Script Map
Check that .php is in the right hand pane and that the data value is C:\php\sapi\phpisapi.dll
If it isn't, in the right hand window, right click the mouse and choose New | String Value, give it the name ".php" and press enter.
Double click on this key and enter the path: C:\\php\\sapi\\php4isapi.dll in the Value Data field and press OK.
Make sure you have printed this document and re-boot your system.


Apache Configuration

You now need to configure Apache to deal with PHP files. A httpd.conf file is included in our QuickSetup.zip
Copy this file to: C:\Program Files\Apache Group\Apache\conf\ and overwrite the existing httpd.conf file.
You can now skip the next section.

Skip if you used the above httpd.conf file
If you want to edit your own httpd.conf, Go: Start > Programs > Apache HTTP Server > Configure Apache Server > Edit the Apache httpd.conf Configuration File
Go to the line: AddType application/x-tar .tgz. Below that line add the following:

ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phpl
AddType application/x-httpd-php .phtml
Action application/x-httpd-php "/php/php.exe"


Search for DocumentRoot and change to: DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs/"

Search for Directory and change it to look like this:
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "C:/Program Files/Apache Group/Apache/htdocs/">


Testing your installation

You now need to use a phpinfo.php script to check your installation.
A phpinfo.php file is included in our QuickSetup.zip
Copy this file to: C:\Program Files\Apache Group\Apache\htdocs\
You can now skip the next section.

Skip if you used the above phpinfo.php file
If you want to create your own phpinfo.php file, open Notepad and type:
<?php
phpinfo();
?>

Save this as C:\Program Files\Apache Group\Apache\htdocs\phpinfo.php


imgStart Apache: Start > Programs > Apache httpd Server > Control Apache Server > Start
Open your browser and type this URL: http://localhost/phpinfo.php
If all was successful, you should be seeing a PHP page with lots of information about your installation. PHP4 is enabled on your server and you are a happy bunny.

If you are not seeing a PHP page, don't panic. Go back and double check that you followed the instructions correctly. It's probably something simple.

Setting up this enviroment up can seem a bit tricky the first time around, but it is worth the effort, and future installations will become alot easier.

<< Home | Services | Portfolio | Support | Contact
© 2008 Red Eye Media  
Visit www.pricewindow.co.uk Valid HTML 4.01! Valid CSS! Reviewed and approved by the Good Net Guide Click to visit UKWDA