无法使PHP在Apache和Windows上作为FastCGI工作

我试图运行PHP作为FastCGI没有成功。

我在mod_fcgid页面上创build了一个* .conf文件,但没有包装脚本。

这是我的conf:

# php5 as FastCGI executable FcgidMaxRequestsPerProcess 10000 # Uncomment the following line if cgi.fix_pathinfo is set to 1 in # php.ini: # FcgidFixPathinfo 1 <Location "D:/www"> AddHandler fcgid-script .php Options +ExecCGI FcgidWrapper "C:/php/php-cgi.exe" .php # Customize the next two directives for your requirements. Order allow,deny Allow from all </Location> 

服务器正常启动,fcgid_module显示为httpd -M ,但php文件是纯文本服务器。

出于好奇,尝试改变你的路线:

 AddHandler fcgid-script .php 

 AddHandler fcgid-script php 

为了让自己启动并运行,你也可以考虑使用mod_fastcgi(注意,不是来自Apache的mod_fcgid)。 一个DLL可以在这里http://www.fastcgi.com/dist/mod_fastcgi-2.4.6-AP22.dll请注意,这是为Httpd 2.2。 (2.4的DLL也可用。)

你的configuration条目看起来像这样:

 LoadModule fcgid_module modules/mod_fcgid.so <IfModule mod_fastcgi.c> Alias /fcgi-bin "C:/www/cgi-bin" FastCgiServer "C:/www/cgi-bin/php-cgi.exe" -initial-env PATH=C:/php -initial-env PHPRC=C:/php AddHandler php-fastcgi .php <Location /fcgi-bin/> Options ExecCGI SetHandler php-fastcgi </Location> AddType application/x-httpd-fastphp .php Action php-fastcgi /fcgi-bin/php-cgi.exe </IfModule> 

你或许可以less走开,但是它在Windows上适用于我。