title: nginx/PHP config problems
body: <p>I'm setting up a new Ubuntu server running nginx, and I'm trying to run a small WordPress blog on the site. I cannot seem to get the configuration for this part right, and I've looked closely at all the docs and online help I could find.</p>
  
  <p>I'm running the blog at www.example.com/blog, and I don't care about any higher location blocks, I just want to get the config right for this one area. I am trying to use:</p>
  
  <pre><code>location /blog/ {
           root /usr/local/www/data;
  
           try_files $uri $uri/ index.php?$args;
           index index.php;
           location ~ \.php$ {
                    fastcgi_pass 127.0.0.1:9000;
                    fastcgi_index index.php;
                    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                    fastcgi_split_path_info ^(/blog)(/.*)$;
                    include fastcgi_params;
           }
  }
  </code></pre>
  
  <p>I have php-cgi running on 127.0.0.1:9000. </p>
  
  <p>When I try to go to www.example.com/blog, or blog/ or blog/index.php, I get the "No input file specified" error. As a test, I created a phpinfo.php file and put that into /usr/local/www/data/blog/, but that gives the same error.</p>
  
  <p>However, as a further test, I put the phpinfo.php file at /, and then changed the param line to "fastcgi_param SCRIPT_FILENAME /phpinfo.php;", and that <em>did</em> work, so it seems that my FastCGI process is correctly running, but for some reason I'm not getting the path set correctly in nginx.</p>
  
  <p>I've looked closely at the discussion of this issue at <a href="http://blog.martinfjordvald.com/2011/01/no-input-file-specified-with-php-and-nginx/" rel="nofollow">http://blog.martinfjordvald.com/2011/01/no-input-file-specified-with-php-and-nginx/</a>, and I have looked at the file permissions, and as far as I can tell, it's all OK. Every directory in the /usr/local/www/data/blog tree has execute permissions, and everything from /usr/local/www on down is owned by, and readable to, the www-data user that runs both nginx and FastCGI.</p>
  
  <p>The logs are not helpful on this; I don't get anything in the error logs even when I set the level to info.</p>
  
  <p>Thanks.</p>