2017-10-15 23 views
0

私は、サーバー上で自分のアプリケーションを実行しようとしていますロードしようとした私は、エラーを持っている:ClassNotFoundExceptionがAsseticBundle

致命的なエラー:キャッチされないのSymfony \コンポーネント\デバッグ\例外\にClassNotFoundException: クラスをロードしようとしました」をAsseticBundle "を名前空間" Symfony \ Bundle \ AsseticBu ndle "から選択します。 別の名前空間に「使用」ステートメントを忘れましたか? Cに:\ XAMPPの\ phpの\ MyBlog \ のPPの\ AppKernel.php:19

<?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 Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), 
      new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), 
      new AppBundle\AppBundle(), 
      new Symfony\Bundle\AsseticBundle\AsseticBundle(), 
     ]; 

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

      if ('dev' === $this->getEnvironment()) { 
       $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); 
       $bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle(); 
      } 
     } 

     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'); 
    } 
} 
+0

あなたはasseticバンドルが実際にインストールされていることを確認するために、ベンダーのディレクトリを確認しましたか? – Cerad

答えて

1

ほとんどの問題は、プロジェクトの依存関係をインストールしていないということです。

てみラン: composer install

関連する問題