FastCGI sent in stderr: "Primary script unknown"

vincent123456 nginx-forum at nginx.us
Tue May 5 10:01:26 UTC 2015


Hi,

I try to configure a vhost with Nginx and PHP-FPM.

I have an application with Symfony2.6, i followed this tutorial : 
http://symfony.com/doc/current/cookbook/configuration/web_server_configuration.html#nginx

I have this error : 
2015/05/05 11:48:32 [error] 5181#0: *5 FastCGI sent in stderr: "Primary
script unknown" while reading response header from upstream, client:
127.0.0.1, server: myserver.local, request: "GET / HTTP/1.1", upstream:
"fastcgi://127.0.0.1:9000", host: "myserver.local"

I followed various tutorials on this problem (google is my friend !!) but it
does not work...

My configuration :

-> Vhost

server {
        server_name  myserver.local;
        root /datas/www/sf_project/web;
        location / {
                try_files $uri /app.php$is_args$args;
        }

        # DEV
        location ~ ^/(app_dev|config)\.php(/|$) {
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_split_path_info ^(.+\.php)(/.*)$;
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
                fastcgi_param HTTPS off;
        }
        # PROD
                location ~ ^/app\.php(/|$) {
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_split_path_info ^(.+\.php)(/.*)$;
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
                fastcgi_param HTTPS off;
                internal;
        }
        error_log /var/log/nginx/error.log;
        access_log /var/log/nginx/access.log;
    }

-> Nginx.conf
user myuser;

-> php-fpm conf :
user = myuser;
group = myuser;

-> ls -al /datas/www
drwxr-xr-x.  8 myuser myuser 4096  5 mai   11:36 sf_project

-> Permission :
/datas/www/sf_project => 755
/datas/www/sf_project/web/app.php => 644

-> OS / Conf :
Fedora 21  / Nginx 1.6.3 / PHP 5.6.8


Thx for your help

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,258653,258653#msg-258653



More information about the nginx mailing list