2
votes

I loaded all files on my PROD env, removed all files and subdirectiories from /var/cache directory and got blank screen.

After adding

ini_set("error_reporting", E_ALL);
ini_set("display_errors", "1");

to the app.php file, i got this error:

Fatal error: Uncaught exception 'Symfony\Component\DependencyInjection\Exception\InvalidArgumentException' with message 'There is no extension able to load the configuration for "web_profiler"

Could anyone tell my why the web profiler is even executed on the PROD environment? It should be used only on TEST or DEV, I think. I can't even clear PROD cache on my localhost server because of this error.

Oh, and in app.php file I got $kernel = new AppKernel('prod', false);, so the web profiler shouldn't be used...

UPDATE

AppKernel.php

<?php

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
            new Symfony\Bundle\TwigBundle\TwigBundle(),
            new Symfony\Bundle\MonologBundle\MonologBundle(),
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
            new Symfony\Bundle\AsseticBundle\AsseticBundle(),
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),

            new JavierEguiluz\Bundle\EasyAdminBundle\EasyAdminBundle(),
            new Ivory\CKEditorBundle\IvoryCKEditorBundle(),
            new Knp\Bundle\MenuBundle\KnpMenuBundle(),
            new Vich\UploaderBundle\VichUploaderBundle(),

            new A2lix\TranslationFormBundle\A2lixTranslationFormBundle(),
            new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),

            new JMS\DiExtraBundle\JMSDiExtraBundle($this),
            new JMS\AopBundle\JMSAopBundle(),
            new JMS\TranslationBundle\JMSTranslationBundle(),

            // my bundles here
        ];

        if(in_array($this->getEnvironment(), ['dev', 'test'], true)) {
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
            $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
            $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
        }

        return $bundles;
    }

    public function getRootDir()
    {
        return __DIR__;
    }

    public function getCacheDir()
    {
        return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();
    }

    public function getLogDir()
    {
        return dirname(__DIR__).'/var/logs';
    }

    public function registerContainerConfiguration(LoaderInterface $loader)
    {
        $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
    }
}
1
can You paste the content of appKernel class and config.yml file - after removing fragile data if any?Rafal Kozlowski
you most likely have a problem in our AppKernel class and/or your config_x.yml files. Mind showing those?Jojo
AFAIK, Profiler does not have to been executed, but there are some configuration under "web_profiler" node in your config.yml that Symfony can't assign to a valid extension. If you don't need profiler, try to remove that configuration block from your config files.Muriano
profiler config file should be loaded from config_dev.yml (in some cases you may need this in other environments) but for sure it must not be placed in config_prod.yml nor config.ymlRafal Kozlowski
@RafalKozlowski I have updated my question.Krzysztof Trzos

1 Answers

4
votes

Ok, I found that I indeed used web_profiler keyword in my config_prod.yml. That was the problem... I'm so mad right now :D.