Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to run nginx and php-cgi on my Windows PC, I've got up to the point where I want to move the html directory back two directory's so I can sort of create a structure.

The only problem I have now is that PHP doesn't pick up any .php file. I have tried loading a static html file (localhost/test.html) and it works fine but localhost/info.php doesn't work at all.

Can anyone give me some guidance on this? The part of the server block can be found below.

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;
        }
share|improve this question

2 Answers 2

up vote 3 down vote accepted

Don't use a relative path in the root directive. Use the absolute path.

share|improve this answer

php-cgi on Windows has a bug concerning relative paths apparently:

[PHP-BUG] Bug #54955 [NEW]: FastCGI doesn't recognize Windows relative paths

Your solutions are:

  1. Absolute paths like what Michael Hampton said.
  2. Junctions.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.