开发者

how to make symfony dump everything to screen

hey folks, this is a really simple question. I'd like symfony to dump everything on its mind to the browser. I deployed to production, and nothing's working. not the logs, not the views, nothing. I just get a blank page.

is it possible to just see a开发者_开发技巧ll of the [php/symfony] errors, somehow?


Such a problem could have multiple source : apache (or any webserver), php, symfony, etc.

I would first try to use the "application_name_dev.php" front controller on production server to see what's going on.

Then enabling log in production is a good idea, on both apache and symfony levels.

for the symfony part in factories.yml (in SF 1.4, don't know about other versions)

prod:   
  logger:
    class: sfAggregateLogger
    param:
      level: err
      loggers:
        sf_file_debug:
          class: sfFileLogger
          param:
            level: err
            file: %SF_LOG_DIR%/%SF_APP%_%SF_ENVIRONMENT%.log

We also use a hook that catch any uncaught exception and send us detail via email, but that's once the website is up


Its generally not advisable to do this in production. Instead make sure you have logging_enabled: true in your settings.yml and then just look at the log file. If youre not getting anything inn your symfony logs, then take a look at the httpd error_log. If you really want to display errors take a look at the settings for the dev environment and copy the necessary settings to display errors.

However, you may still get the white screen of death if memory is being exhausted or the server is segfaulting.


If anyone is still using Symfony2 you can try changing this line

$kernel = new AppKernel('prod', false);

to

$kernel = new AppKernel('prod', true);

Source: http://symfony.com/doc/current/cookbook/configuration/environments.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜