Concrete5 on Nginx, works once (and then dies)

Permalink 2 users found helpful
I'm running into a weird problem on an nginx server I'm installing Concrete5 on. Your help would be very much appreciated. I realise that Apache is the prefered server, but sometimes you've got to make lemonade.

Let me explain.

Initially, after uploading the concrete5 directory, the setup tells me that "Supports concrete5 request URLs" is not OK, and "concrete5 cannot parse the PATH_INFO or ORIG_PATH_INFO information provided by your server." After weeding through various forum posts and asking the hosting providers, the following nginx configuration seems to solve this. Mind you, I'm a beginner at nginx and am in no way certain if this is actually solving the problem or just solving the error message (and I fear the latter).

location / {
    if (!-e $request_filename) {
        rewrite  ^(.*)$  /index.php?/$1 last;
        break;
    }
}


After adding this to the configs, the setup actually does its thing. I am actually able to load the homepage. But here's the kicker. The page only loads once. Just once. After visiting it again, I get the following error:

Fatal error: Call to a member function validate() on a non-object in public_html/concrete5/concrete/core/models/permission/access/model.php on line 51


That's odd! Does anyone know how that might be related to the first problem, and what I might do about it?

Now here's some more icing on the cake - in fact, it might provide a direction to look into.. Whenever I start a new private session (in Firefox) or browse to the page from a fresh machine, I get my 'one working pageload' again. It does not matter which page I request - be it the login form or a content page. The first page gets loaded just fine, and then the second page (and any page after that) comes up with the error listed above. This hints that it might be something to do with user sessions.. but that's weird, since we seem to be dealing with serversided inconsistencies!

I am truly clueless.

JoostRijneveld
 
MathijsVos replied on at Permalink Best Answer Reply
I've encountered the same problem when I was using C5 on a host that used Redis for session storage. For me the problem disappeared after disabling Redis and moving to MySQL storage for sessions.
JoostRijneveld replied on at Permalink Reply
JoostRijneveld
You're the best.

Seriously, this post deserves some exposure. This fixed it. One simple click in the configs; luckily the host has this stuff readily available in the configs, so that's silver lining.