21489 Posts in 5783 Topics by 2622 members
| Go to End | Next > | |
| Author | Topic: | 1189 Views |
-
SS3 on lighttpd - /dev/xxx returns blank screen

16 June 2012 at 1:32am Last edited: 16 June 2012 1:50am
Hi everyone
I'm having a problem with ss3 on lighttpd: the frontend and cms seem to work fine, but all urls starting with /dev/ return blank screens (no errors)
I'm using the default settings here http://doc.silverstripe.org/sapphire/en/trunk/installation/lighttpd, as they always worked on 2.4...
The weird thing is that the proper functions are called: DevelopmentAdmin->Index() on /dev/, TaskRunner->Index() on /dev/tasks/ For instance: if I add an exit(); to the end of the Taskrunner->index() function, all the tasks are now printed to the screen just fine. But after that something happens that results in a blank...
I do not have any problems with Apache. Of course it could be due to some other settings I have made in Lighttpd, but I really don't know where to look any more...
[EDIT - even trimmed lighttpd.conf to the bare minimum at the temp. expense of all other sites...]
Can anyone reproduce this?
Thanks, Martine
-
Re: SS3 on lighttpd - /dev/xxx returns blank screen

18 June 2012 at 10:46pm
Hmmm. Interesting, I have the same problem on a live server with Apache. Did not have time to thoroughly look, will let you know if I find a fix.
-
Re: SS3 on lighttpd - /dev/xxx returns blank screen

19 June 2012 at 1:12am
That's strange. Are you referring to 3.0 as well? So maybe it isn't a lighttpd thing at all. Anyone else have this?
It looks like some redirect happens after the tekst is displayed - for instance /dev/tasks/ should only display the list of tasks and do nothing else after that. But if I remove the exit() from the Taskrunner->index() function, obviously it does do something else (turn everything to white)
And there are no errors... And firebug doesn't help...
-
Re: SS3 on lighttpd - /dev/xxx returns blank screen

19 June 2012 at 5:38am Last edited: 19 June 2012 5:41am
So far:
In my case the culprit was output buffering, preventing headers from being sent automatically with the generated output. So SilverStripe tries to create the headers 'manually' in SS_HTTPResponse->output(). Unfortunately the HTTPRespons body is always empty, so the Content-Length header is set to 0. That's the blank screen...One way of getting the headers to be sent automatically seems to be flushing the output buffer.
In SS_HTTPResponse->output() around line 224:
} else {
ob_flush(); <-- ADD
if(!headers_sent()) {
header($_SERVER['SERVER_PROTOCOL'] . " $this->statusCode " . $this->getStatusDescription());
foreach($this->headers as $header => $value) {
header("$header: $value", true, $this->statusCode);
}
}
...This works but I've no idea yet about the impact on other code...
Another option would be to set output_buffering = off in php.ini
But obviously the respons body shouldn't be empty in the first place, and I don't quite know how that should be accomplished just yet, so this is not really a patch. I'll try and find a better solution to create one.
-
Re: SS3 on lighttpd - /dev/xxx returns blank screen

21 June 2012 at 9:46pm
Applied your fix to my production environment , did the trick as well.
And yes, I'm referring to SS3 on Apache. Ssssttrrraaaange, no ?
Should we raise a ticket about this ?
-
Re: SS3 on lighttpd - /dev/xxx returns blank screen

26 June 2012 at 2:30am Last edited: 26 June 2012 2:31am
So I created a ticket here - and then found out after I submitted it that the ob_flush() solution had issues after all
I think this temporary(!) fix might work better, but it definitely isn't a patch and I wisely kept it from the ticket this time. It removes the Content-Length header if it is 0. Tested in ff, safari, chrome on mac:
HTTPResponse.php line 227 - replace:
foreach($this->headers as $header => $value) {
header("$header: $value", true, $this->statusCode);
}
byforeach($this->headers as $header => $value) {
if ($header != 'Content-Length' || $value != '0') {
header("$header: $value", true, $this->statusCode);
}
} -
Re: SS3 on lighttpd - /dev/xxx returns blank screen

6 July 2012 at 10:18am
Not a solution, but I found you can force the output by including the showqueries parameter however there's a lot of output to sort through after.
/dev/build?flush=all&showqueries
For now I'm doing my /dev/build from the command line where it seems to work fine.
framework/sake dev/build flush=all
-
Re: SS3 on lighttpd - /dev/xxx returns blank screen

12 July 2012 at 1:28am
Just for extra info: I cannot get any output from dev/build either, but have found that adding the parameter debug=1 forces some output - and it may be less extra output than showqueries (which doesn't force output for me).
| 1189 Views | ||
| Go to Top | Next > |



