你的WEB服务器是APACHE,还是PWS.
如果是apache:以模块方式加载PHP,方法如下:
在httpd.conf中加入以下几行:
=======================================
LoadModule php4_module X:/php/sapi/php4apache2.dll
#(如APAHCE是2.0以下版本将上行2去掉,并去掉下一行的注释)
# AddModule mod_php4.c AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
=======================================
在httpd.conf 中 AddDefaultCharset iso8859 该行改为 AddDefaultCharset gb2312复制php\dlls\*.* -->windows\system32\
复制php\php4ts.* -->windows\system32\
复制或修改php.ini-dist -->winnt\php.ini
php.ini中session.save_path = "c:\windows\temp" 或 = "./" 也可
extension_dir = X:/../php/extensions/
重起Apache.
如果是apache:以模块方式加载PHP,方法如下:
在httpd.conf中加入以下几行:
=======================================
LoadModule php4_module X:/php/sapi/php4apache2.dll
#(如APAHCE是2.0以下版本将上行2去掉,并去掉下一行的注释)
# AddModule mod_php4.c AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
=======================================
在httpd.conf 中 AddDefaultCharset iso8859 该行改为 AddDefaultCharset gb2312复制php\dlls\*.* -->windows\system32\
复制php\php4ts.* -->windows\system32\
复制或修改php.ini-dist -->winnt\php.ini
php.ini中session.save_path = "c:\windows\temp" 或 = "./" 也可
extension_dir = X:/../php/extensions/
重起Apache.
复制php\php4ts.* -->windows\system32\
复制或修改php.ini-dist -->winnt\php.ini
php.ini中session.save_path = "c:\windows\temp" 或 = "./" 也可
extension_dir = X:/../php/extensions/ The recommended method for configuring these servers is to use
the REG file incuded with the distribution (pws-php4cgi.reg).
You may want to edit this file and make sure the extensions and PHP
install directories match your configuration - once you have done
this, just double click on the file and it will update your registry.
Alternatively, 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: .php
Double click on the new string value and enter the path to
php.exe in the value data field.
ex: c:\php\php.exe
Repeat these steps for each extension you wish to associate
with PHP scripts. The following steps do not affect the web server installation and only
apply if you want your php scripts to be executed when they are run
from the command line (ex. run c:\myscripts\test.php) or by double
clicking on them in a directory viewer window. You may wish to skip
this step as you might prefer the php files to load into a text
editor when you double click on them. 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: .php
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:\php\php.exe -q %1
(don't forget the '%1').
Exit Regedit.
If using PWS on Windows, reboot to reload the registry.
PWS and IIS 3 users now have a fully operational system. IIS 3
users can use a nifty tool available at
http://www.genusa.com/iis/iiscfg.html
from Steven Genusa to configure their script maps.