Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lumen unpredictable output

Tags:

php

laravel

lumen

Recently, I installed lumen (5.0.4) mfw and ran into an issue with page load on default configuration. I have unpredictable behavior of page load process.

Sometimes it loads okay but sometimes instead of loading I am getting a download dialog with zero size unnamed file or it throws an exception like

NotFoundHttpException in Application.php line 1109:

(At first, I want to say that other non lumen/laravel sites work fine) Server configuration:

  • Apache 2.4.12
  • PHP 5.6.7-1
  • Zend Engine v2.6.0 with Zend OPcache v7.0.4-dev

I think the problem is with php working through php-fpm because with fcgi configuration it seems to work well.

I tried NotFoundHttpException with Lumen but that didn't help me.

like image 696
mixone Avatar asked Apr 24 '15 11:04

mixone


1 Answers

I have same issue, after hours of research and debug, I fixed the issue.

If you are doing something like this ...

$app->run($httpRequest);

instead do ...

$httpRequest = Illuminate\Http\Request::capture();
$app->run($httpRequest);

Hope this is helpful. Thanks!

like image 73
Madan Sapkota Avatar answered Nov 19 '22 22:11

Madan Sapkota