使用codeigniter的mpdf生成错误我在服务器中遇到致命错误
Error in mpdf genertion using codeigniter i got fatal error in server
在 /home/project//public_html/application/third_party/mpdf/mpdf.php on line 1519
中调用未定义的函数 mb_internal_encoding()
Error
:
A PHP Error was encountered
Severity: Error
Message: Call to undefined function mb_internal_encoding()
Filename: mpdf/mpdf.php
Line Number: 1519
Backtrace:
But it is correctly working in localhost
我的控制器
public function viewpdf($key,$option) {
if($option=='1')
{
$searchdata['fetchproduct']=$this->b2bproduct_model->fetch_productdata1($key);
}
if($option=='2')
{
$searchdata['fetchproduct']=$this->b2bproduct_model->fetch_productdata2($key);
}
if($option=='3')
{
$searchdata['fetchproduct']=$this->b2bproduct_model->fetch_productdata3($key);
}
$html=$this->load->view('moderator/pdf_data', $searchdata,true);
//this the the PDF filename that user will get to download
$pdfFilePath = "shany.pdf";
//load mPDF library
$this->load->library('m_pdf');
//generate the PDF from the given html
$this->m_pdf->pdf->WriteHTML($html);
//download it.
$this->m_pdf->pdf->Output($pdfFilePath, "I");
}
与CI没有任何关系。
有一个名为 php_mbstring 的扩展,很可能 PHP 未使用此扩展编译。
为了检查我的假设是否正确,请使用 extension_loaded 函数,例如
extension_loaded('mbstring');
并检查它 returns 是对还是错。
在 /home/project//public_html/application/third_party/mpdf/mpdf.php on line 1519
mb_internal_encoding()
Error
:
A PHP Error was encountered
Severity: Error
Message: Call to undefined function mb_internal_encoding()
Filename: mpdf/mpdf.php
Line Number: 1519
Backtrace:
But it is correctly working in localhost
我的控制器
public function viewpdf($key,$option) {
if($option=='1')
{
$searchdata['fetchproduct']=$this->b2bproduct_model->fetch_productdata1($key);
}
if($option=='2')
{
$searchdata['fetchproduct']=$this->b2bproduct_model->fetch_productdata2($key);
}
if($option=='3')
{
$searchdata['fetchproduct']=$this->b2bproduct_model->fetch_productdata3($key);
}
$html=$this->load->view('moderator/pdf_data', $searchdata,true);
//this the the PDF filename that user will get to download
$pdfFilePath = "shany.pdf";
//load mPDF library
$this->load->library('m_pdf');
//generate the PDF from the given html
$this->m_pdf->pdf->WriteHTML($html);
//download it.
$this->m_pdf->pdf->Output($pdfFilePath, "I");
}
与CI没有任何关系。 有一个名为 php_mbstring 的扩展,很可能 PHP 未使用此扩展编译。
为了检查我的假设是否正确,请使用 extension_loaded 函数,例如
extension_loaded('mbstring');
并检查它 returns 是对还是错。