我在我的symfony2-project (2.6.*)中使用dompdf-bundle (slik/dompdf-bundle)来生成html中的pdf。这在我的开发环境(MAMP)中,在dev (app_dev.php)和prod-模式下工作得很好。
在prod环境中,使用完全相同的数据(DB) --代码(GIT) --我得到了一个错误。所以我检查了服务器的配置(PHP)。有趣的是:当我用app_dev.php运行时,这代人工作得很好!app.php和app_dev.php有什么不同?
我得到的错误:德文错误信息
我的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;
}发布于 2016-01-17 20:50:06
我用工作解决了我的问题。我将dompdf包替换为mpdf包。这个方案适用于我的解决方案:https://github.com/tasmanianfox/MpdfPortBundle
https://stackoverflow.com/questions/34738241
复制相似问题