Angel
Angel

Reputation: 612

Error in mpdf genertion using codeigniter i got fatal error in server

Call to undefined function mb_internal_encoding() in /home/project//public_html/application/third_party/mpdf/mpdf.php on line 1519

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

my contoller

 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");   
      }

Upvotes: 0

Views: 1085

Answers (1)

Atural
Atural

Reputation: 5439

It doesn't have anything to do with CI. There is an extension which is called php_mbstring, and most likely PHP isn't compiled with this extension.

In order to check if my assumption is correct use the extension_loaded function such as

extension_loaded('mbstring');

and check if it returns true or false.

Upvotes: 1

Related Questions