PROD envにすべてのファイルをロードし、/var/cache
ディレクトリからすべてのファイルとサブディレクトリを削除し、空白の画面が表示されました。Symfony 3 - WebProfilerが私のPRODをオンにしていますenv
app.php
ファイルに
ini_set("error_reporting", E_ALL);
ini_set("display_errors", "1");
を追加した後、私はこのエラーを得た:ウェブプロファイラがさえPROD環境上で実行されている理由
Fatal error: Uncaught exception 'Symfony\Component\DependencyInjection\Exception\InvalidArgumentException' with message 'There is no extension able to load the configuration for "web_profiler"
誰もが私に教えてもらえますか? TESTまたはDEVでのみ使用する必要があります。このエラーのため、私はローカルホストサーバにPRODキャッシュをクリアできません。
ああ、およびウェブプロファイラを使用すべきではありませんので、app.php
ファイルで、私は、$kernel = new AppKernel('prod', false);
を得た...
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');
}
}
appKernelクラスとconfig.ymlファイルの内容を貼り付けることができますか? –
AppKernelクラスやconfig_x.ymlファイルで問題が発生している可能性があります。それらを示す心? – Jojo
AFAIK、Profilerは実行される必要はありませんが、symfonyが有効な拡張子に割り当てることができないconfig.ymlの "web_profiler"ノードの下にいくつかの設定があります。プロファイラが必要ない場合は、設定ファイルからその設定ブロックを削除してみてください。 – Muriano