依赖文件的搜索顺序:首先是 php.exe 所在的目录,如果是 ISAPI 模式,那么会搜索 Web Server 的启动位置,比如 Apache 的 bin 目录;其次是 Windows PATH 环境变量中的目录。这里不要复制任何文件到 Windows 目录中,有必要的话,可以把 C:\php5 加到 PATH 中,便于以后 PHP 的升级。
安装 Nginx 从 v0.7.52 开始,Nginx 开始发布 Windows 版本的 Nginx,你可以在其官方网站上面下载: http://nginx.net
如果需要老版本的 Nginx for Windows,可以在 Kevin Worthington 的网站上面找找。
另外一种方式是使用第三方工具,比如 PHP-FPM 、cgi-fcgi 等。显然!要在 Windows 中使用这些工具是件极其痛苦的事情,你可能需要 Cygwin 之类的东西才行,的确有人这么做了,虽然我觉得那是自寻烦恼。
下一步,修改 Nginx ,将 php 请求转发至 PHP FastCGI Server:
. 代码如下: # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 location ~ ^(.+\.php)(.*)$ { root D:/public_html; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include php.conf; }