doushenyu8228
2017-08-16 06:10
浏览 75
已采纳

在codeigniter中使用dompdf而不是在现场制作pdf

I am creating pdfs using this code

$dompdf->loadHtml($html);
$dompdf->setPaper('A4', 'portrait');
$dompdf->render();
$pdf = $dompdf->output();
file_put_contents($this->config->item('file_path') . $pdf_name, $pdf);
$data['pdf'] = site_url('uploads/pdf/' . $pdf_name);

It works perfectly on XMPP localhost, but on LIVE server I get this error.

A PHP Error was encountered
<p>Severity: Warning</p>
<p>Message:  file_put_contents(/home/xyz/public_html/abc/uploads/pdf/quotation_1502863603.pdf): failed to open stream: No such file or directory</p>
<p>Filename: controllers/Admin.php</p>
<p>Line Number: 742</p>

Please guide me what could be the issue on a LIVE server?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

相关推荐 更多相似问题