Windows - PHP & GD2 
Prerequisites
Read the main windows chapter before reading and sub-chapters. 
Must have functioning web server installed 
PHP >= 4.3 for the GD2 extension available here 
About this Document
This document will point you where to get PHP and also provide help on enabling GD2 for the graph generation in Psychostats. By default GD2 comes with the zip distribution of PHP >= 4.3 but it is disabled. If you have an older version of PHP and are unable to upgrade please see the PHP Documentation for information about getting GD2 to work. 

Installing PHP
First thing you need to do is download the PHP installer which can be found on the PHP Downloads page.

IIS - Download the MSI package and run it. Follow the on screen prompts and PHP should install itself into IIS. (More Detailed Instructions Comping Soon) 

Apache - Download the zip distribution because it has to be installed manually. You can install with the MSI first to get all the files in place but you will need extra files from the zip download to install the API version of PHP which is recommended. See the install.txt for installation instructions for apache. (More Detailed Instructions Comping Soon) 

Enabling GD2 
If you used only the MSI installer you will not have the GD2 extension installed on your system. We have just the GD2 extension for download here, this is the same file that is available with the full PHP 4.3.4 zip distribution. Extract the php_gd2.dll into C:\PHP\extensions (this may be a different folder if you did not accept the default installation directory). If that folder does not exist inside your PHP folder then create it. 

Open C:\windows\php.ini or C:\winnt\php.ini (depending on your system setup) in your favorite text editor (notepad works). Use the find function to search for extension_dir, in notepad use the Edit menu and select Find. For the default PHP installtion this needs to be set to:

extension_dir = "C:\PHP\extensions\" 
If you installed PHP to a different folder adjust this accordingly. Now search for gd2, you should see a line like this:

;extension=php_gd2.dll
Simply remove the ";" in front of the line to un comment it so it looks like this

extension=php_gd2.dll
Then restart your web server application and GD2 should be working.

To test to see if GD is working just browse to the testgd.php file in your statsroot. ( http://yoursite.com/stats/testgd.php )

