Software, Web Development

Nginx Truncating Any Web Page With or Without PHP

I had a problem recently (or rather, just now) whereby one of my Nginx installs was truncating PHP pages.

I soon figured out it was because Nginx was actually showing me the in-memory buffer output and cutting off file buffer. You see Nginx will first try and load your entire page into memory, when failing this it will pump the output to a file.

The problem is if Nginx cannot write to that file for some reason it will only give you the first in-memory output of a page.

The way to find out if this is happening to you and how to solve it is detailed here: but I will summarise it here to prevent link rot.

Your error.log should have a line like:

2014/07/08 08:19:25 [crit] 30100#0: *308814 open() "/var/lib/nginx/fastcgi/0/11/0000005110" failed (13: Permiss ion denied) while reading upstream, client:, server: localhost, request: "GET /xxxx/xxxx-xxxx  HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "", referrer: ""

And put simply, double check the permissions of your folders/files in: /var/lib/nginx/fastcgi, there is a very good chance they are not of the right permissions.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s