在nginx和php-cgi上没有指定input文件

我试图在Windows PC上运行nginx和php-cgi,我已经到了要将html目录移回到两个目录的位置,所以我可以创build一个结构。

我现在唯一的问题是,PHP不会拿起任何.php文件。 我曾尝试加载一个静态HTML文件(localhost / test.html),它工作正常,但localhost / info.php根本不工作。

任何人都可以给我一些指导呢? 服务器块的一部分可以在下面find。

server { listen 80; server_name localhost; root ../../www; index index.html index.htm index.php; #charset koi8-r; #access_log logs/host.access.log main; location ~ \.php$ { fastcgi_pass 127.0.0.1:9123; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } 

不要在root指令中使用相对path。 使用绝对path。

Windows上的php-cgi显然有一个关于相对path的错误:

[PHP-BUG] Bug#54955 [NEW]:FastCGI无法识别Windows相对path

您的解决scheme是:

  1. 像迈克尔汉普顿所说的绝对path。
  2. 连接 。