douhushen3241 2017-03-22 08:04
浏览 121
已采纳

DOMPDF错误:类Dompdf \ FrameDecorator \ AbstractFrameDecorator没有资金

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...

  • 写回答

1条回答 默认 最新

  • dtt5830659 2017-03-22 19:22
    关注

    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...

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分