what is the otc equivalent to phentermine phentermine 37.5mg how to take phentermine and topiramate

ambien sleep cooking ambien online no prescription free online ambien music radio

can i take tramadol for uti buy tramadol online farmacocinГ©tica y farmacodinamia del tramadol

toddler ingested xanax xanax no prescription how many days early can you refill xanax

alprazolam Rochester buy xanax xanax movies

xanax short acting benzodiazepine buy xanax xanax sr 0 5 mg ára

soma sema artificial heart blogspot soma muscle relaxant soma devlet kömür işletmeleri

ambien in philippines buy ambien will ambien kill a dog

how long before i can take more tramadol tramadol 50 mg tramadol 50 mg and paracetamol

tramadol no markings tramadol 50mg which is better tylenol 3 or tramadol

Running Laravel Lumen from sub-directory

April 15, 2015 11 comments Posted in Tutorial

Lumen is the new micro framework from laravel, you can found more info here : Lumen Website.

I ran lumen without homestead, just plain apache. After opening the /public folder i got this error :

Route not found :(

Next, i try to run lumen with php artisan serve, and its work 😀

I’am curious, so i dig into the lumen framework bootstraper. If you open public/index.php, it will trigger $app->run(). The app is instance of Laravel\Lumen\Application and you can find the source on vendor/laravel/lumen-framework/src/Application.php.

the run method in turn will call dispatch :

From the code we can infer that if no request object is pass (default is null) then lumen will try to get the path info from its own method. In my case, if we run Lumen from sub directory, the path will be absolute path from your server hostname. Which lead to route not found problem.

My solution for this is to create Symfony request object on public/index.php

Thats all, it work on my case. Hope this work on yours too !

11 comments

  1. Andrey Sokolov 3 years ago

    Thanks, you solved my problem ^_^

    • Todi Adiyatmo 3 years ago

      glad to hear that !

  2. someone 3 years ago

    TYSVM!!!!!!

  3. Krik Batner 3 years ago

    Thanks for this! Couldn’t figure this out for the life of me!

  4. mattgreen110 3 years ago

    Thank you so much for this!

  5. thx 3 years ago

    very usefull. thank you for that post. wish that was mentioned in the lumen documentation

    • thx 3 years ago

      Just a note – when doing anything usefull you might encounter an error like
      “must be an instance of IlluminateHttpRequest, instance of SymfonyComponentHttpFoundationRequest” with this fix.

      That can be solved by using

      IlluminateHttpRequest instead of SymfonyComponentHttpFoundationRequest

      and use Request::capture(); instead of Request::createFromGlobals();

  6. ask a lawyer 3 years ago

    They should add your article…I spend almost 2~3 hours try to fix this by changing the .htaccess

  7. it works, thanks

  8. tripper54 2 years ago

    Thank you, this is the best solution I’ve seen!

  9. Ibrahim Lawal 1 year ago

    Awesome solution.

    For Lumen 5.3, this will fail, so any one trying this now should use “IlluminateHttpRequest” instead of “SymfonyComponentHttpFoundationRequest”

    Hope this helps someone

Leave a Comment

Your email address will not be published. Required fields are marked *
*