在 PagodaBox 上部署我的应用程序后,我遇到了一个原则错误。它在我的本地机器上的 dev 和 prod 环境中都可以正常工作,但实时站点返回此错误:
致命错误:在 /var/www/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/DoctrineBundle.php:101 中包含消息“传递非法值(未给出数组或字符串)”的未捕获异常“LogicException”:101 堆栈跟踪: #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} 在 /var/www/vendor/doctrine/doctrine-bundle/ 中抛出Doctrine/Bundle/DoctrineBundle/DoctrineBundle.php 在第 101 行
每次部署应用程序时都会清除缓存。任何建议将不胜感激,因为我完全被难住了!
更新:
我进行了更多调试,发现即使在 prod 环境中,kernel.cache_dir 参数也设置为 /var/www/app/cache/dev。这意味着教义缓存目录设置不正确,因为它依赖于其他参数。我认为 kernel.cache_dir 是根据环境自动设置的。