laravel / lumen-framework

The Laravel Lumen Framework.
https://lumen.laravel.com
MIT License
1.48k stars 419 forks source link

A little problem with .env #1159

Closed Joker-DW closed 3 years ago

Joker-DW commented 3 years ago

Description:

The application is running by php-fpm.But i can see nothing in the browser,it's blank.

Steps To Reproduce:

I checkd error log of the nginx,but nothing. I checkd error log of the Lumen,but nothing.

There are no error logs anywhere,but it's blank in the browser.

I don't understand what happend.

So I tracked the code.

By tracking the problem, I found the answer.

Lumen code:/bootstrap/app.php (new Laravel\Lumen\Bootstrap\LoadEnvironmentVariables(dirname(__DIR__)))->bootstrap();

/Bootstrap/LoadEnvironmentVariables.php The code catch the InvalidFileException In the bootstrap(),then call writeErrorAndDie(). And I can see the code die(1) at the end of writeErrorAndDie(), So I know mybe have someting wrong in .env.

code in /.env KEY=awxrgdew 432d

I found a space in the KEY. So I changed the value of the KEY.

KEY=awxrgdew432d or KEY="awxrgdew 432d"

The problem was solved.

But I want to know why catch the exception in bootstrap() of /Bootstrap/LoadEnvironmentVariables.php? And why terminate my program with die?

I think use die or exit in the package is very dangerous. Sometimes we need to handle the exception,not package. If the package want to catch it,but don't terminate the program.

Waiting for a reply.

Thx.

driesvints commented 3 years ago

Hey there,

Unfortunately we don't support this version anymore. Please check out our support policy on which versions we are currently supporting. Can you please try to upgrade to the latest version and see if your problem persists? We'll help you out and re-open this issue if so.

Thanks!

Joker-DW commented 3 years ago

Hey there,

Unfortunately we don't support this version anymore. Please check out our support policy on which versions we are currently supporting. Can you please try to upgrade to the latest version and see if your problem persists? We'll help you out and re-open this issue if so.

Thanks!

Hi Boss, I will try it and reply you later.

Joker-DW commented 3 years ago

Hey there,

Unfortunately we don't support this version anymore. Please check out our support policy on which versions we are currently supporting. Can you please try to upgrade to the latest version and see if your problem persists? We'll help you out and re-open this issue if so.

Thanks!

Hi Boss,

I upgraded to the package to 8.2.3,and the browser is blank again,and no error log.

So I tracked the code,and i found just one change is die to exit!

Joker-DW commented 3 years ago

@driesvints Hi Boss,FYI

driesvints commented 3 years ago

@Joker-DW this is a support request which we don't handle here unfortunately. Please try one of the following channels:

Thanks.