Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

TuffRivers's avatar

DomPDF Different on server vs local?

Hi All,

just pushed app updates to my dev server from my local - developing on xampp windows 10 and pushing to ubuntu/linux server on digital ocean - everything is working as intended but my HTML > PDF is not rendering the same as it is on my local - everything is out of whack and i have no clue why - no errors in my log file but my invoice PDF which is one page is coming out to like 6 with all blanks.

Any ideas what i could try?

these are my dom pdf options

$invoice->setOptions(['defaultFont' => 'dejavu sans','enable_font_subsetting' => 'true','enable_html5_parser'=>'true']);

0 likes
5 replies
jlrdw's avatar

Do you have all extensions that's required enabled?

1 like
TuffRivers's avatar

Seem to be, DOM, MBstring and i have PHP 7.2 installed!

1 like
jlrdw's avatar

For me or someone to better help you, give version numbers of everything, laravel, version of the pdf package, etc.

But also double check yourself first for a dependency mismatch. Dependencies would be in the various composer.json files.

1 like
TuffRivers's avatar

So i did a double check - same versions of dompdf installed - upgraded my server from 7.2 to 7.4 to match my local - updated all packages, checked phpinfo for differences - something weird happening on the development server, when i run Log::debug($data_returned_from_query_builder): I get this error

"Object of class stdClass could not be converted to string"

And its pointing to the 'message' key in the $record array for /monolog/monolog/src/Monolog/Logger.php

      $record = array(
            'message' => (string) $message,
            'context' => $context,
            'level' => $level,
            'level_name' => $levelName,
            'channel' => $this->name,
            'datetime' => $ts,
            'extra' => array(),
        );

Wondering if this is a bigger problem - clue why i cant even run log debug on my dev envi

1 like
TuffRivers's avatar

For anyone who is wondering - i updated my entire server as well and all my packages (linux Ubuntu from 16 -> 20) and it started to work!

Please or to participate in this conversation.