Вопрос

I'm getting a doctrine error after deploying my app on PagodaBox. It works fine in both dev and prod environments on my local machine but the live site returns this error:

Fatal error: Uncaught exception 'LogicException' with message 'Illegal value passed (no array or string given)' in /var/www/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/DoctrineBundle.php:101 Stack trace: #0 /var/www/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/DoctrineBundle.php(101): spl_autoload_register(NULL) #1 /var/www/app/bootstrap.php.cache(2275): Doctrine\Bundle\DoctrineBundle\DoctrineBundle->boot() #2 /var/www/app/bootstrap.php.cache(2303): Symfony\Component\HttpKernel\Kernel->boot() #3 /var/www/web/app.php(23): Symfony\Component\HttpKernel\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #4 {main} thrown in /var/www/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/DoctrineBundle.php on line 101

The cache is cleared every time the app is deployed. Any suggestions would be gratefully received because I'm totally stumped!

UPDATE:

I've done some more debugging and I have discovered that even in the prod environment the kernel.cache_dir parameter is set to /var/www/app/cache/dev. This means that the doctrine cache dir is being incorrectly set as it relies on this other parameter. I thought the kernel.cache_dir was set automatically depending on the environment.

Это было полезно?

Решение

I finally got this sorted. It was down to using eAccelerator as my opcode cache. It turns out that there is a bug in eAccelerator that means it can't process closures correctly. I'm now using XCache and it is all working fine.

Другие советы

This is the auto-loading failing in DoctrineBundle.php Line 101:

 $this->autoloader = Autoloader::register($dir, $namespace, $proxyGenerator);

Your passing NULL to the $dir argument, which judging by the exception its requires either an array() or string.

You can see that the method uses $dir from the configuration variable doctrine.orm.proxy_dir (Line 64).

$dir = $this->container->getParameter('doctrine.orm.proxy_dir');`

My guess is that you have not defined this path correctly

Edit - Take a look here for Doctrine's configuration which includes the proxy_dir setting.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top