# Temporary "File not found" error

**URL:** <https://www.ruby-forum.com/t/temporary-file-not-found-error/225628>\
**Category:** NGINX\
**Created:** [January 20, 2013, 1:39pm UTC](https://www.ruby-forum.com/t/temporary-file-not-found-error/225628 "2013-01-20T13:39:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [January 20, 2013, 1:39pm UTC](https://www.ruby-forum.com/t/temporary-file-not-found-error/225628/1 "2013-01-20T13:39:16Z")

</div>

About one month ago I had set up a new server configuration, since then  
I  
struggle with an annoying temporary error.  
Most of the time everything works fine, but after some period of time, I  
sometimes receive “File not found” errors when I try to acces a PHP  
file.

access log:  
a.b.c.d - - [20/Jan/2013:13:14:38 +0100] “GET /intern/phpMyAdmin/  
HTTP/1.1”  
404 47 “-” “Mozilla/5.0 (X11; Ubuntu; Linux x86\_64; rv:18.0)  
Gecko/20100101  
Firefox/18.0” “-”  
a.b.c.d - - [20/Jan/2013:13:14:39 +0100] “GET /intern/phpMyAdmin/  
HTTP/1.1”  
200 2378 “-” “Mozilla/5.0 (X11; Ubuntu; Linux x86\_64; rv:18.0)  
Gecko/20100101 Firefox/18.0” “-”

error log:  
2013/01/20 13:14:38 [error] 26428#0: \*6892 FastCGI sent in stderr:  
“Primary  
script unknown” while reading response header from upstream, client:  
a.b.c.d, server: [abc.de](http://abc.de), request: “GET /intern/phpMyAdmin/ HTTP/1.1”,  
upstream: “fastcgi://127.0.0.1:10000”, host: “[abc.de](http://abc.de)”

Two request, the first on throws an error, the second one is fine.  
So there is only one of the two php-fpm workers affected?  
Since it is working most of the time, I don’t think it has something to  
do  
with file permissions?

Perhaps someone has an idea whats wrong with my configuration?

Thanks in advance!

nginx config:  
root /srv/www/abc.de/public/www;  
access\_log /srv/www/abc.de/log/access.log main;  
error\_log /srv/www/abc.de/log/error.log warn;

location / {  
index index.html index.htm index.php;  
}

location ~ .php$ {  
if ( !-f $request\_filename ) {  
return 404;  
}

```
    include /etc/nginx/fastcgi_params;
    fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;

    fastcgi_param DOCUMENT_ROOT /public/www;
    fastcgi_param SCRIPT_FILENAME

```

/public/www$fastcgi\_script\_name;  
fastcgi\_param PATH\_INFO $fastcgi\_path\_info;  
fastcgi\_param PATH\_TRANSLATED  
$document\_root$fastcgi\_path\_info;  
fastcgi\_pass 127.0.0.1:10000;  
fastcgi\_index index.php;  
}

fastcgi\_params:  
fastcgi\_param QUERY\_STRING $query\_string;  
fastcgi\_param REQUEST\_METHOD $request\_method;  
fastcgi\_param CONTENT\_TYPE $content\_type;  
fastcgi\_param CONTENT\_LENGTH $content\_length;

fastcgi\_param SCRIPT\_FILENAME $request\_filename;  
fastcgi\_param SCRIPT\_NAME $fastcgi\_script\_name;  
fastcgi\_param REQUEST\_URI $request\_uri;  
fastcgi\_param DOCUMENT\_URI $document\_uri;  
fastcgi\_param DOCUMENT\_ROOT $document\_root;  
fastcgi\_param SERVER\_PROTOCOL $server\_protocol;

fastcgi\_param GATEWAY\_INTERFACE CGI/1.1;  
fastcgi\_param SERVER\_SOFTWARE nginx/$nginx\_version;

fastcgi\_param REMOTE\_ADDR $remote\_addr;  
fastcgi\_param REMOTE\_PORT $remote\_port;  
fastcgi\_param SERVER\_ADDR $server\_addr;  
fastcgi\_param SERVER\_PORT $server\_port;  
fastcgi\_param SERVER\_NAME $server\_name;

fastcgi\_param HTTPS $https;

# PHP only, required if PHP was built with --enable-force-cgi-redirect

fastcgi\_param REDIRECT\_STATUS 200;

fastcgi\_connect\_timeout 120;  
fastcgi\_send\_timeout 180;  
fastcgi\_read\_timeout 180;  
fastcgi\_buffer\_size 128k;  
fastcgi\_buffers 4 256k;  
fastcgi\_busy\_buffers\_size 256k;  
fastcgi\_temp\_file\_write\_size 256k;  
fastcgi\_intercept\_errors on;

php-fpm pool config:  
[abc]  
prefix = /srv/www/abc.de/

listen = 127.0.0.1:10000  
listen.backlog = -1  
listen.allowed\_clients = 127.0.0.1  
listen.owner = www-data  
listen.group = www-data  
listen.mode = 666

user = www-data  
group = www-data

pm = dynamic  
pm.max\_children = 30  
pm.start\_servers = 2  
pm.min\_spare\_servers = 1  
pm.max\_spare\_servers = 10  
pm.max\_requests = 500

pm.status\_path = /php\_pool\_abc\_status  
ping.path = /abc\_ping  
ping.response = abc\_pong

request\_terminate\_timeout = 0  
request\_slowlog\_timeout = 1  
slowlog = log/php-slow.log  
access.log = /srv/www/abc.de/log/abc\_pool.access.log

chroot = $prefix  
chdir = /public/

security.limit\_extensions = .php .php3 .php4 .php5

env[HOSTNAME] = $HOSTNAME  
; env[PATH] = /usr/local/bin:/usr/bin:/bin  
env[TMP] = /tmp  
env[TMPDIR] = /tmp  
env[TEMP] = /tmp

php\_flag[display\_errors] = off  
php\_admin\_value[error\_log] = /log/php\_err.log  
php\_admin\_flag[log\_errors] = on  
php\_flag[suhosin.session.encrypt] = off

Posted at Nginx Forum:

> **[Temporary "File not found" error](https://forum.nginx.org/read.php?2,235335,235335#msg-235335)**
>
> About one month ago I had set up a new server configuration, since then I struggle with an annoying temporary error. Most of the time everything works fine, but after some period of time, I sometimes receive "File not found" errors when I...
