DomPDF在本地主机中的行为与GoDaddy Hosting不同

时间:2016-10-04 18:58:38

标签: laravel localhost hosting dompdf

我有问题与DomPDF问题是它在localhost中工作得很好但是当我在Hosting中尝试时它给了我这个错误:

     ErrorException in Cpdf.php line 3547:
    Undefined index:
in Cpdf.php line 3547
at HandleExceptions->handleError('8', 'Undefined index: ', '/home/imphusius/public_html/cafeconor/vendor/dompdf/dompdf/lib/Cpdf.php', '3547', array('size' => '12')) in Cpdf.php line 3547
at Cpdf->getFontHeight('12') in CPDF.php line 809
at CPDF->get_font_height('/home/imphusius/public_html/cafeconor/vendor/dompdf/dompdf\lib\fonts\Times-Roman', '12') in FontMetrics.php line 352
at FontMetrics->getFontHeight('/home/imphusius/public_html/cafeconor/vendor/dompdf/dompdf\lib\fonts\Times-Roman', '12') in Text.php line 188
at Text->_layout_line() in Text.php line 362
at Text->reflow(object(Block)) in AbstractFrameDecorator.php line 801
at AbstractFrameDecorator->reflow(object(Block)) in Block.php line 738
at Block->reflow(null) in AbstractFrameDecorator.php line 801
at AbstractFrameDecorator->reflow() in Page.php line 133
at Page->reflow(null) in AbstractFrameDecorator.php line 801

有人会知道错误来自哪里以及为什么?

1 个答案:

答案 0 :(得分:0)

我前段时间在另一台主机上遇到过类似的问题。经过一段时间的实验证明,清除主机内置缓存并执行php artisan cache:clear(可能是php artisan route:clear就足够了)解决了这个问题。如果这也是您的情况,我建议使用Laravel cron作业安排此缓存擦除。
如果有帮助,请告诉我。