Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have installed nginx and php (fpm). static files are being served fine.

I created a simple info.php


I browse to my url http://xx.xx.xx.xx/info.php and see a:

File not found.

my config:

server {
    listen 80 default_server;

    root /mnt/data/aws/public;
    index index.php index.html index.htm;

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;

nginx error log reports:

2014/02/11 21:44:45 [error] 18109#0: *8 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: xx.xx.xx.xx, server: , request: "GET /info.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "xx.xx.xx.xx"

I guess this would mean that SCRIPT_FILENAME is incorrect? how can I test, fix this?

File permissions seem to be correct /mnt/data/aws/public all have execute permissions info.php currently is 777.

share|improve this question

Your Answer


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

Browse other questions tagged or ask your own question.