How to make Symfony dump everything to screen

Hey guys, this is a very simple question. I would like Symfony to dump everything in its memory to the browser. I turned to production and nothing worked. not magazines, not views, nothing. I just get a blank page.

Is it possible to just view all the [php / symfony] errors, somehow?

+2


a source to share


3 answers


This problem can have several sources: apache (or any web server), php, symfony, etc.

I first tried using the front controller "application_name_dev.php" on the production server to see what was going on.

Then putting the log into production is a good idea at the apache and symfony levels.



for the symfony part in .yml factories (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 catches any uncaught exception and sends us the details by email, but after the site is up

+1


a source


It is generally not recommended to do this in production. Instead, make sure you have logging_enabled: true

in settings.yml

and then just look at the log file. If you don't get anything in your symfony logs take a look at httpd error_log

. If you really want to display errors, look at the settings for the environment dev

and copy the necessary settings for displaying errors.



However, you can still get a white screen of death if memory is depleted or the server is interrupted.

+1


a source


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

+1


a source







All Articles