Microsoft Windows 下的 Xitami

本节包含针对 Windows 下的 Xitami 的说明与提示。

注: 应该首先阅读手工安装步骤

下面列出了怎样在 Windows 下在 Xitami 中设置 PHP 的 CGI 方式。

CGI 用户重要提示: 请阅读 FAQ:cgi.force_redirect 中的重要细节。此选项需要被设为 0。如果想要使用 $_SERVER['PHP_SELF'],还必须激活 cgi.fix_pathinfo 选项。

警告

如果使用 CGI 方式安装,则服务器对于某些可能的攻击是开放的。请阅读 CGI 安全一章以学习如何防御这些攻击。

  • 确保 web 服务器在运行,在浏览器中打开 Xitami 的管理控制台(通常是 http://127.0.0.1/admin),并点击 Configuration。

  • 找到 Filters,在 File extensions(.xxx)字段中加入想要 PHP 解析的后缀名(例如 .php)。

  • 在 Filter command 或 script 中输入 PHP 的 CGI 可执行文件名,例如 PHP 4 是 C:\php\php.exe,PHP 5 是 C:\php\php-cgi.exe

  • 点击“Save”图标。

  • 重启动服务器以使改动生效。


add a note add a note User Contributed Notes
ae_engine at yahoo dot com
02-Nov-2004 10:07
I have successfully configured Xitami using cgi.redirect
in PHP
set cgi.redirect = 1
set cgi.redirect_status = CGI_REDIRECT_STATUS;

in Xitami, defaults.cfg
under CGI_ENVIRONMENT
insert CGI_REDIRECT_STATUS="-"
rjb1 at catalog dot net dot au
18-Sep-2004 10:23
I am running xitami as a business www server on ms-windows. I have a number of long-running PHP scripts. I developed a tiny java applet to receive and display progressive status information from these slow scripts. It effectively facilitates SERVER PUSH from PHP scripts to IE and Netscape browsers.  Take a look: catalog.net.au/netClient.zip (Ron Boles, Melbourne, Australia)
rjb1 at catalog dot net dot au
12-Apr-2004 08:57
PHP via ISAPI with XITAMI
I have developed a small GUI in c++, which runs XITAMI and configures the Xitami ISAPI interface for use with PHP. It is so much faster than the PHP cgi interface and appears to be more stable too.
Take a look here: http://catalog.net.au/xisapi/default.html
Ron Boles
Melbourne, Australia
Roshambo
17-Oct-2003 04:39
I was only able to get PHP (4.3.3) working under Xitami (2.5c0) on Windows XP (SP1) by adding the following lines to defaults.cfg:

[Mime]
   php=application/x-httpd-php
  
[Filter]
   .php="c:/php/php.exe"

Note the quotation marks and the forward slashes in the filter section.
david at advisorymatters dot co dot uk
12-Sep-2003 07:54
Using the CGI (c:\php[version]\php.exe) with Xitami since PHP version 4.3.2 requires the following setting in php.ini before the $_SERVER['PHP_SELF'] call will return a value:

cgi.fix_pathinfo=1

Note that $_SERVER['SCRIPT_NAME'] still works.
janko dot slavic at email dot si
01-Dec-2002 06:51
[Editors Note]
You can force IE to disregard a cached page by pressing the Control key and click the Refresh button.

Please, do not forget the IE caches files.

I had a test.php and got the error message. I changed the defaults.cfg and also the cgi.force_redirect to = 0. After restarting the Xitami the error message was still there.
After a while I saved the test.php file to test2.php and found that it is working fine...