0
votes

I use the dompdf-bundle (slik/dompdf-bundle) in my symfony2-project (2.6.*) for the generation of pdf out of html. This works fine in my dev envirenment (MAMP) in dev (app_dev.php) and prod-mode.

In the prod envirenment I get an error with the exactly same data (DB) an code (GIT). So I checked the configuration of the server (PHP-version). Funny: When I run the prod-envirenment with app_dev.php the generation works fine!!! Where is the different between the app.php and the app_dev.php?

The error I get: Error message in german

My 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;
    }
1
did you added the bundle just for the dev env ? Please show us where you load the bundle: AppKernel.phpibasaw
@ibasaw see the updated description and thanks for your support.westhian
What is the error you get?xabbuh

1 Answers

0
votes

I solved my issue with a work-around. I replaced the dompdf bundle with the mpdf bundle. This one works fine for my solution: https://github.com/tasmanianfox/MpdfPortBundle