2016-10-09 8 views
1

作者は本番環境でsymfonyをインストールできません。すべてが開発でうまく動作します。すべての権限は問題ありません。Symfony composer install - 未知のSymfony Component Debug Exception ClassNotFoundException:クラス "SensioGeneratorBundle"を読み込もうとしました

PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "SensioGeneratorBundle" from namespace "Sensio\Bundle\GeneratorBundle". 
Did you forget a "use" statement for another namespace? in /home/ev/app/AppKernel.php:25 
Stack trace: 
#0 /home/ev/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(396): AppKernel->registerBundles() 
#1 /home/ev/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(114): Symfony\Component\HttpKernel\Kernel->initializeBundles() 
#2 /home/ev/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php(68): Symfony\Component\HttpKernel\Kernel->boot() 
#3 /home/ev/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php(118): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 
#4 /home/ev/bin/console(27): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Inp in /home/ev/app/AppKernel.php on line 25 

これはAppKernel.phpのライン25である:

$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); 

任意の提案は、製品版のenvironnmentで歓迎:)

答えて

3

あり、SensioGeneratorBundleがregistredではありません。 このバンドルには、次のようにDEVバンドルのように定義する必要があります。

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

そして、あなたの作曲ファイル内:

"require-dev": { 
    "sensio/generator-bundle": "~2.3" 
} 

あなたが製品版のENVでこのバンドルから生成コマンドを使用する場合は、あなたが移動する必要がありますdevからProdへの宣言(推奨しません)

+0

ありがとう!これは私の問題を修正 – lhio

関連する問題