我在我的symfony2-project(2.6。*)中使用dompdf-bundle(slik / dompdf-bundle)来生成html中的pdf。这在dev(app_dev.php)和prod-mode中的dev envirenment(MAMP)中工作正常。
在prod envirenment中,我得到了完全相同的数据(DB)和代码(GIT)的错误。所以我检查了服务器的配置(PHP版本)。有趣:当我用app_dev.php运行prod-envirenment时,这一代工作正常! app.php和app_dev.php之间的区别在哪里?
我得到的错误: Error message in german
我的AppKernel.php:
public function registerBundles()
{
$bundles = array(
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 Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new AppBundle\AppBundle(),
new GaertnerhuusBundle\GaertnerhuusBundle(),
new GaertnerhuusAdminBundle\GaertnerhuusAdminBundle(),
new Slik\DompdfBundle\SlikDompdfBundle()
);
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();
}
return $bundles;
}
答案 0 :(得分:0)
我通过解决方案解决了我的问题。我用mpdf包替换了dompdf包。这个适用于我的解决方案: https://github.com/tasmanianfox/MpdfPortBundle