Question

I am following the tutorial. When I am using the command

php app/console doctrine:fixtures:load

then I am getting an error

C:\wamp\www\Symfony>php app/console doctrine:fixtures:load
'stty' is not recognized as an internal or external command,
operable program or batch file.

  [RuntimeException]

  The autoloader expected class "Symfony\Bundle\DoctrineFixturesBundle\DoctrineF
ixturesBundle" to be defined in file "C:\wamp\www\Symfony\app/../vendor/bundles\
Symfony\Bundle\DoctrineFixturesBundle\DoctrineFixturesBundle.php". The file was
found but the class was not in it, the class name or namespace probably has a ty
po.

I am new to symfony2.

Was it helpful?

Solution

The first problem I notice is that you don't use the correct namespace of the DoctrineFixturesBundle. I suggest you to update the library.

WARNING: Namespace changed

This bundle was previously under the Symfony\Bundle namespace and is now moved to the Doctrine\Bundle namespace.

Secondly, you need to declare the DoctrineFixturesBundle inside your AppKernel.

// ...
public function registerBundles()
{
    $bundles = array(
        // ...
        // Be carefull with the namespace!
        new \Doctrine\Bundle\DoctrineFixturesBundle\DoctrineFixturesBundle(),
        // ...
    );
    // ...
}

You can find further information here: DoctrineFixturesBundles (not up to date!)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top