Install php-3_ORCx-win32.exe, following the installation directives. The installation shoud create a C:\php directory.
Copy the files php.exe, *.dll from this directory to [SERVER_ROOT]/cgi-bin/
Note:[SERVER_ROOT] is intended for the apache root directory, commonly C:\Apache
Edit the php3.ini file located in the WinNT/ directory.
Some changes are to be done in the following sections.
This section contains the main PHP configuration directives.
It can be usefull -at least during the installation process- to keep a trace of errors in a log file:
You must check the cgi_ext directive, which defines the extension your php files will have. We'll use php3 here.
Note:The PHP files extension (php3 here ) must be the same you will configure for Apache: isapi_ext is used for a IIS server. nsapi_ext is used for a Netscape Server
If you plan to use upload files fonctionnality, define the directory where php will store the temporary uploaded files.
If you plan to use the mail()
function, change:
This section defines which DLL should be loaded. The .DLL files are located in [SERVER_ROOT\cgi-bin] since you copied them in A For example, if you plan to use GD ( Graphic functions library ), add:
We assume that : Apache server is located in the usual ``c:\Apache'' directory. PHP scripts have .php3 extension
Edit the Apache access.conf config file, located in SERVER_ROOT/conf/ . ( httpd.conf if Apache version 1.3.5 or up )
Check the the cgi-bin directory config. It must have the ExecCGI directive :
Edit the Apache srm.conf config file, located in SERVER_ROOT/conf/<br>
Check for or add the directive that will declare your cgi-bin directory:
Add the directive to declare the MIME-Type for the PHP3 files. The format is AddType [mime-type] [file extension]
Add the directive that will bind the php.exe program with the php mime-type.
The previous directives will allow simplified urls , ie. http://server/directory/my_script.php3 instead of http://server/cgi-bin/php.exe/directory/my_script.php3
Save the configs files, and restart Apache using the NT Services utilities found in the Control Panel.
Create a simple test.php3 file, and save it somewhere under [SERVER_ROOT]/htdocs directory.
The purpose of this test is to isolate any PHP specific problem. Open a DOS Shell in the directory where test.php3 is, and try the script:
If you don't get this, check PHP3.INI. Only when done, you may try the remote test.
Open a browser, point it to the URL of your script, in our example : http://localhost/test.php3
If you get no response, have a look in the Apache error_log file. Also check the PHP log file ( should be [SERVER_ROOT]/logs/php3.log ) . They might give you some hints
Here are some common configuration problems and solutions.
Please note that each time you make a change in Apache conf files (httpd.conf, srm.conf, access.conf) , you have to restart Apache service after
A possible reasons is that the php3.ini file is missing in WinNT/ directory.
-> Copy Apache/cgi-bin/php3.ini-dist to WinNT/php3.ini, and configure it. [ PHP configuration ]
-> Check that you have the AddType and Action directives correctly defined in Apache config file
This means Apache doesn't recognize properly the PHP3 mime-type.
-> Check that you have the same mime-type (application/x-httpd-php3) in AddType and Action directives:
This happens when the Action directive contains a syntax error in path.<br>
-> Check that the Action directive is correct, see Apache Configuration
( [warn] handler ``php3-script'' not found for: [php file] )
This warning in Apache/log/error_log, is often not an error. It appears also when the AddHandler directive is defined. It seems to be a cosmetic bug in Apache.
You may have not defined the path where php looks for library files.
-> Check the extension_dir directive in php3.ini
-> Also notes that since PHP version 3.03, library files have been renamed with a leading php_. ( ie gd.dll becomes php3_gd.dll ). You may have this error with existing php scripts when upgrading.
( This problem was reported when using libmysql.dll. )
-> Move the missing library to a library directory, for instance under [WIN]\System32.
This document written by Leo West - 1998/99
You can send me any questions about Apache or PHP3 configuration on WinNT @ mailto:lwest@free.fr