Installing PHP

 

To begin, download the source files from http://www.php.net.

You need two files;

 

The PHP Program

The complete package; requires manual configuration;

PHP 5.0.4 zip package
[7,488Kb] - 31 Mar 2005

 

A Library of Extensions

PHP Extension Community Library (PECL)

Collection of PECL modules for PHP 5.0.4
[1,342Kb] - 31 Mar 2005

 

How To Install

Unzip the files. The PHP needs to go to the directory C:\PHP, where C is the system hard drive (has the Windows OS on it). You will need to create this directory. When you have done this, unzip the Pecl (pronounced pickle) file to C:\PHP\ext\.

Open up the main directory C:\PHP, and copy the following three files into your system folder (C:\windows\system32\).

php5isapi.dll

php5nsapi.dll

php5ts.dll

 

How to Configure PHP

In the php folder there is a file called php.ini-dist. Rename this file to php.ini and save it in C:\windows. This is the initialization file for php. The settings in it are read each time PHP starts up. You need to configure this file for PHP to run properly. When you open this file in a text editor such as notepad or wordpad, you will see a long list of settings and comments describing the settings. All comments start with a semi-colon (;) and have no effect on PHP.

 

Editing php.ini

The php.ini contains nearly two thousand lines of code. We need to change about three of them. The first thing you need to look for is a section called Paths and Directories. It's located at about line 400 and looks like this;

;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
;include_path = ".;d:\php\includes"

; The root of the PHP pages, used only if nonempty.
; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root
; if you are running php as a CGI under any web server (other than IIS)
; see documentation for security issues. The alternate is to use the
; cgi.force_redirect configuration below
doc_root = "c:/Inetpub/wwwroot"

; The directory under which PHP opens the script using /~username used only
; if nonempty.
user_dir =

; Directory in which the loadable extensions (modules) reside.
extension_dir = "c:/php/ext"

The two lines shown in boldface type may need to be edited if they do not point to your PHP file and wwwroot folder (see Installing IIs if you are unsure about what your wwwroot folder is). The correct values are in the code shown above.

Next at line 475 or so look for this section of code;

;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
upload_tmp_dir ="c:/Inetpub/uploads"

; Maximum allowed size for uploaded files.
upload_max_filesize = 2M

Again, check the values are the same as the ones shown above.

Now go down a bit further to the windows extensions;

;Windows Extensions
;Note that ODBC support is built in, so no dll is needed for ;it.

This is a list of extensions that can be turned on if you need them You turn them on by removing the semi-colon from the beginning of the line. Find and change these two extensions from

;extension=php_gd2.dll

;extension=php_imap.dll

to

extension=php_gd2.dll

extension=php_imap.dll

Save and close your php.ini file.

 

Install PHP Cont. -- Adding PHP to the IIS Webserver