Laravel 4 debugging not working

情到浓时终转凉″ 提交于 2019-12-03 16:29:22

问题


It's extremely frustrating that I have 'debug' => true in the app config but all Laravel is showing is "Whoops, looks like something went wrong." For the love of coding, does somebody know how to get debugging to work?


回答1:


I have faced the same problem. Laravel was showing only "Whoops, looks like something went wrong." but this line and not showing the actual error. Then I have checked the app/config/app.php file and changed "debug" => false to "debug" => true and it worked perfectly.

You said that you have also done it and still not working. I suggest you to run a composer update command for your project and then try again.




回答2:


To be sure your app is in development mode, edit bootstrap/start.php, in the detectEnvironment function simply put your machine name. On linux use hostname terminal commande to determine your machine name.

$env = $app->detectEnvironment(array(
  'local' => array('homestead', 'Jeanphi'),
));



回答3:


Actually debugging is working fine for me with L4.0.7 when i set 'debug' => true in app/config/app.php That switch tells Laravel to turn on Whoops and to bypass the 'compiled.php' file. When it is disabled, Whoops will not show. A normal server error page is served instead.

Were you expecting something else?

EDIT: maybe you are referring to "debugging" as the old profiler bar that were in L3 (Anbu). In that case I suggest you install this package




回答4:


Check you haven't renamed your app/config folder as fideloper suggests in the comment.

For example you might have renamed it to prevent overwriting the default config settings when copying your site somewhere else.




回答5:


For all it's worth, I was getting this error now after deployment because I didn't create these folders:

/app/storage/cache
/app/storage/logs
/app/storage/meta
/app/storage/sessions
/app/storage/views



回答6:


Some changes need an apache restart to take effect.




回答7:


I came across problem recently, after separating out debug and a few other config options into a separate (dev.php) config file.

The in-hindsight obvious, by-logic obscure solution: Don't move debug out of config/app.php




回答8:


Had that same problem altought my app was in debug mode. In my case I was deploying on server,and to make that work you must take care of detectEnvironment variable.

It is located in bootstrap/start.php

$env = $app->detectEnvironment(array(

       'local' => array('your_server_name'),

));

as it's instructed in the docs :

http://laravel.com/docs/4.2/configuration




回答9:


i got same problem with that... first, laravel run well on windows using apache.. then while i'm using ubuntu and nginx, it shows "Whoops, looks like something went wrong."

no error in php log and nothing found on laravel log..

so i tried modify path folder permission to 0777

sudo chmod -R 0777 {put your folder application folder here}

it works




回答10:


I had the same problem several times and I have two possibilities.

  • the folder storage doesn't have the right permissions, you should use chmod 755 or chmod 777
  • the public/index.php has none permission or a 777

These two options has occurred to me before, maybe there are some more.




回答11:


well you need to clear configuration cache and regenerate it each time you change config files

run 'php artisan config:cache' in console and your good to go



来源:https://stackoverflow.com/questions/18787342/laravel-4-debugging-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!