learningsymfony
learningsymfony

Reputation: 65

Symfony debugger is still enabled even on production

I'm every confused of this behaviour. I Set my env to production and the debugger is still available on prod enviorment.

My .env file is like so

APP_ENV=production

And here is my Bundles Config.

    <?php

$bundles = [
    Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
    Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
    Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
    Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
    Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
    Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
    Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
    Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
    EightPoints\Bundle\GuzzleBundle\EightPointsGuzzleBundle::class => ['all' => true],
];

if ('dev' === $_SERVER['APP_ENV']) {

    $devBundles = [
        Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true],
        Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
        Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true]
    ];

    return array_merge($bundles, $devBundles);
}

return $bundles;

Does anyone know why my Debug is still working on prod ?

For example:

http://localhost/asd/

Returns the Symfony output error..

ResourceNotFoundException NotFoundHttpException HTTP 404 Not Found No route found for "GET /asd/"

Any help is apreciated.

Edit: I'm not sure if this helps but this is what i found.

If i set me APP_EVN to dev

My WebProfilerBundle is Loading, if I set it to production back it does not load.

Upvotes: 1

Views: 796

Answers (1)

Mochilo
Mochilo

Reputation: 311

The default production environment is called prod. So you have to change it to:

APP_ENV=prod

Upvotes: 3

Related Questions