0

I'm getting this error:
Fatal error: Class 'Dompdf\FrameDecorator\AbstractFrameDecorator' not found in /public_html/vendor/dompdf/dompdf/src/FrameDecorator/Page.php on line 23
Locally works just fine, but on live server is trowing that error

$dompdf = new Dompdf();
$dd = (OBJECT)array(
    'ss'=>$data->ss,
    'cr'=>date('Y-m-d'),
    'c_n'=>$data->c_n
);
$path = PHCERT .'/';
$dompdf->set_option('defaultFont', 'Courier');
$view = $this->view()->make('pdf.cert', compact('dd'))->render();
$dompdf->loadHtml($view);
$dompdf->setPaper('A4', 'landscape');

$dompdf->render();
$oupdf = $dompdf->output();
$f_name = $data->names.'_'.time().'_'.$data->radn.'.pdf';

if(!file_put_contents($path . $f_name, $oupdf)) {
    $res['file_path'] = 'fail';
}

I the php error log doesn't say much but the same error, the apache error log doesn't say anything about it... so, I have no idea what that error only happen on live server...
php version on live server is 5.6.30
php version on local server is 5.6.25

I'm using the most recent version of dompdf, as well my other libs. I'm using composer to update my libs... I have no idea whats the problem...

Tanker
  • 1,178
  • 3
  • 16
  • 49
  • did you check your composer.json and app.php if you have included DOMPDF ? – Aditya Singh Mar 22 '17 at 08:14
  • yes I have, the composer.json is correct, and the app.php(different name but I know what you mean) is loading ok(I'm using PSR-4 btw), locally all works fine, live server just that part... all files have been deployed to the server... – Tanker Mar 22 '17 at 08:18
  • idk if this will work , but remove it from app.php(or whichever file you are referring to), try composer update, then paste it again and see if it works – Aditya Singh Mar 22 '17 at 08:42
  • You'er on the right track, what I did was, `composer dump-autoload -o` and then everything worked just fine... I have no idea what was the problem maybe the `ClassLoader.php` file was't updated properly and what I did, did in fact updated... dunno... – Tanker Mar 22 '17 at 19:15
  • glad it worked. Cheers ! – Aditya Singh Mar 23 '17 at 05:07

1 Answers1

0

Updating composer PSR-4 seems to fix this: composer dump-autoload -o did in fact fixed the problem.

I did check for the class to exist before the update, after that there wasn't much change on the files dompdf, specially files inside FrameDecorator, none of them changed, the question remains, what could be cause for that error to show?... no bad html, no need for html5 and no bad css... who knows...

Tanker
  • 1,178
  • 3
  • 16
  • 49