15

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.

Community
  • 1
  • 1
mixone
  • 159
  • 3
  • 3
    Inspect Apache's error log for that vhost. It will contain information about what went wrong. – N.B. May 01 '15 at 10:39
  • 2
    This is almost certainly not a problem with Lumen. It sounds like PHP-FPM is crashing and since Apache cannot pass this request on to FPM simply returns the file unprocessed. – Danny Kopping May 02 '15 at 09:28
  • What does your FPM log say? – Danny Kopping May 02 '15 at 09:29
  • I'm more interested in the php-fpm log as well. It should be located in `/var/log/php-fpm.log` on most distros. – John M. May 03 '15 at 12:39
  • NotFoundHttpException indicates that no route matches the request. Maybe something with the URL rewriting? You could modify the exception handler to print the request details to the app log. http://lumen.laravel.com/docs/errors#handling-errors This may shed some light on the issue. – Collin James Jun 04 '15 at 14:53
  • Sound like something with php-fpm as others already commented; you could also test the alternative .htaccess that the documentation provides (http://lumen.laravel.com/docs/installation#pretty-urls) – could perhaps be an issue with some of your Apache modules? – Marcus Olsson Jun 05 '15 at 07:29
  • Show us your routes and an example of the path the page you are accessing that has issues. What cases does it fail? – James Taylor Jun 11 '15 at 01:17
  • 1
    Problem was in server configuration, I reinstall apache & php-fpm and now lumen works fine – mixone Jun 13 '15 at 20:37
  • 3
    Can you mark question as answered please, even if you answer your own question. – kurdtpage Jun 24 '15 at 19:53
  • it may helps you. Simple tutorial about lumen http://wsnippets.com/create-rest-api-using-lumen-micro-framework-by-laravel/ – user2943773 Jun 25 '15 at 04:19
  • 1
    Possible duplicate of [NotFoundHttpException with Lumen](http://stackoverflow.com/questions/29728973/notfoundhttpexception-with-lumen) – Chamin Wickramarathna Apr 23 '17 at 10:45

2 Answers2

3

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!

Madan Sapkota
  • 25,047
  • 11
  • 113
  • 117
0

Change $app->run(); to $app->run($app['request']); in public/index.php (Lumen 5.2)

VipindasKS
  • 516
  • 7
  • 15