PHP3 Home Page

Manual Table of Contents
Up to Installation
Quick Reference
Installation
* Installing From Source on UNIX
* PHP3 Installation Guide for Windows
* Problems?
* Security
Manual: PHP3 Installation Guide for Windows
View the source code for this pageSearch the site



Previous page
 Installation
Problems? 
Next page


PHP3 Installation Guide for Windows

This install guide will help you install and configure PHP3 on your Windows 9x/NT webservers. This guide was compiled by Bob Silva. The latest revision can be found at http://www.umesd.k12.or.us/php/win32install.html.

This guide provides installation support for:

Personal Web Server (Newest version recommended)
Internet Information Server 3 or 4
Apache 1.3.x
Omni HTTPd 2.0b1

Configuration Changes for PHP3

All modules are now prefixed with 'php3_'. You will need to change your php3.ini file and/or any scripts loading extensions with the dl() function (or you could always remove the 'php3_' prefix). This will prevent confusion between php modules and their supporting libraries.

The ChangeLog, FAQ and updated documentation can always be found at the offical PHP website or any of its mirrors.

General Installation Steps

The following steps should be performed on all installations before the server specific instructions.

  • Extract the distribution file to a directory of your choice. "C:\PHP3\" is a good start.

  • Copy the file, 'php3-dist.ini' to your '%WINDOWS%' directory and rename it to 'php3.ini'. Your '%WINDOWS%' directory is typically:

    c:\windows for Windows 95/98
    c:\winnt or c:\winnt40 for NT servers

  • Edit your 'php3.ini' file:

    • You will need to change the 'extension_dir' setting to point to your php-install-dir, or where you have placed your 'php3_*.dll' files. ex: c:\php3

    • Set the 'doc_root' to point to your webservers document_root. ex: c:\apache\htdocs or c:\webroot

    • Choose which modules you would like to load when PHP starts. You can uncomment the: 'extension=php3_*.dll' lines to load these modules. Some modules require you to have additional libraries installed on your system for the module to work correctly. The PHP FAQ has more information on where to get supporting libraries. You can also load a module dynamically in your script using: dl("php_*.dll");

    • On PWS and IIS, you can set the browscap.ini to point to: 'c:\windows\system\inetsrv\browscap.ini' on Windows 95/98 und 'c:\winnt\system32\inetsrv\browscap.ini' on NT Server. Additional information on using the browscap functionality in PHP can be found at this mirror, select the "source" button to see it in action.

Windows 95/98/NT and PWS/IIS 3

The recommended method for configuring these servers is to use the INF file included with the distribution (php_iis_reg.inf). You may want to edit this file and make sure the extensions and PHP install directories match your configuration. Or you can follow the steps below to do it manually.

WARNING: These steps involve working directly with the windows registry. One error here can leave your system in an unstable state. We highly recommend that you back up your registry first. The PHP Development team will not be held responsible if you damage your registry.

  • Run Regedit.

  • Navigate to: HKEY_LOCAL_MACHINE /System /CurrentControlSet /Services /W3Svc /Parameters /ScriptMap.

  • On the edit menu select: New->String Value.

  • Type in the extension you wish to use for your php scripts. ex: .php3

  • Double click on the new string value and enter the path to php.exe in the value data field. ex: c:\php3\php.exe %s %s. The '%s %s' is VERY important, PHP will not work properly without it.

  • Repeat these steps for each extension you wish to associate with PHP scripts.

  • Now navigate to: HKEY_CLASSES_ROOT

  • On the edit menu select: New->Key.

  • Name the key to the extension you setup in the previous section. ex: .php3

  • Highlight the new key and in the right side pane, double click the "default value" and enter phpfile.

  • Repeat the last step for each extension you set up in the previous section.

  • Now create another New->Key under HKEY_CLASSES_ROOT and name it phpfile.

  • Highlight the new key phpfile and in the right side pane, double click the "default value" and enter PHP Script.

  • Right click on the phpfile key and select New->Key, name it Shell.

  • Right click on the Shell key and select New->Key, name it open.

  • Right click on the open key and select New->Key, name it command.

  • Highlight the new key command and in the right side pane, double click the "default value" and enter the path to php.exe. ex: c:\php3\php.exe -q %1. (don't forget the %1).

  • Exit Regedit.

PWS and IIS 3 users now have a fully operational system. IIS 3 users can use a nifty tool from Steven Genusa to configure their script maps.

Windows NT and IIS 4

To install PHP3 on an NT Server running IIS 4, follow these instructions:

  • In Internet Service Manager (MMC), select the Web site or the starting point directory of an application.

  • Open the directory's property sheets (by right clicking and selecting properties), and then click the Home Directory, Virtual Directory, or Directory tab.

  • Click the Configuration button, and then click the App Mappings tab.

  • Click Add, and in the Executable box, type: c:\path-to-php-dir\php.exe %s %s. You MUST have the %s %s on the end, PHP will not function properly if you fail to do this.

  • In the Extension box, type the file name extension you want associated with PHP scripts. (You must repeat step 5 and 6 for each extension you want accociated with PHP scripts. (.php3 and .phtml are common)

  • Set up the appropriate security. (This is done in Internet Service Manager), and if your NT Server uses NTFS file system, add execute rights for I_USR_ to the directory that contains php.exe.

Windows 9x/NT and Apache 1.3.x

You must edit your srm.conf or httpd.conf to configure Apache to work with the PHP CGI binary.

Although there can be a few variations of configuring PHP under Apache, this one is simple enough to be used by the newcomer. Please consult the Apache Docs for further configuration directives.

  • ScriptAlias /php3/ "c:/path-to-php-dir/php.exe"

  • AddType application/x-httpd-php3 .php3

  • AddType application/x-httpd-php3 .phtml

  • Action application/x-httpd-php3 "/php3/php.exe"

To use the source code highlighting feature, simply create a PHP script file and stick this code in: . Substitute original_php_script.php3 with the name of the file you wish to show the source of. (this is only one way of doing it). Note: On Win-Apache all back slashes in a path statement such as: "c:\directory\file.ext", must be converted to forward slashes.

Omni HTTPd 2.0b1 for Windows

This has got to be the easiest config there is:

Step 1: Install Omni server
Step 2: Right click on the blue OmniHTTPd icon in the system tray and select Properties
Step 3: Click on Web Server Global Settings
Step 4: On the 'External' tab, enter: virtual = .php3 | actual = c:\path-to-php-dir\php.exe
Step 5: On the Mime tab, enter: virtual = wwwserver/stdcgi | actual = .php3
Step 6: Click OK

Repeat steps 2 - 6 for each extension you want to associate with PHP.

PHP Modules

Table 3-1. PHP Modules

php3_calendar.dllCalendar conversion functions
php3_crypt.dllCrypt functions
php3_dbase.dllDBase functions
php3_dbm.dllGDBM emulation via Berkely DB2 library
php3_filepro.dllREAD ONLY access to filepro databases
php3_gd.dllGD Library functions for gif manipulation
php3_hyperwave.dllHyperWave functions
php3_imap4r2.dllIMAP 4 functions
php3_ldap.dllLDAP functions
php3_msql1.dllmSQL 1 client
php3_msql2.dllmSQL 2 client
php3_mssql.dllMSSQL client (requires MSSQL DB-Libraries
php3_mysql.dllMySQL functions
php3_nsmail.dllNetscape mail functions
php3_oci73.dllOracle functions
php3_snmp.dllSNMP get and walk functions (NT only!)
php3_zlib.dllZLib functions


User Contributed Notes: PHP3 Installation Guide for Windows


barryp@medicine.nodak.edu
25-Jan-1999 05:01
I found that with Apache 1.3.4 for Windows, the "Action" configuration line can't contain a drive letter. If you try something like:

Action application/x-httpd-php3 "d:/php3/php.exe"

Apache complains about an invalid URI. Just using "/php3/php.exe" works fine (assuming it's on the same drive as apache).



alistk@hotmail.com
17-Mar-1999 01:03
I followed the directions for setting the Apache directives listed above under the heading Windows 9x/NT and Apache 1.3.x, and Apache complained about an invalid URI. I found the following settings worked fine: ScriptAlias /php3/ "C:/Php3/" AddType application/x-httpd-php3 .phtml AddType application/x-httpd-php3 .php3 Action application/x-httpd-php3 "/php3/php.exe" This was using Apache 1.3.4 with php3 on Windows 95.


pkessler@nt.ac-strasbourg.fr
28-Mar-1999 05:03
To have a good operating installation on Windows, do not use directory names with spaces, such c:/program files/apache group/apache.


wiggins@greencis.net
27-Apr-1999 10:04
If you move your apache from the program files directery be sure to change the directery under the apache group registery string.


 About Notes


Previous page
 Installation
Problems? 
Next page



Site Statistics


Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Some elements of this website are subject to copyright.