Php 调用未定义的函数Mpdf\mb_regex_encoding()

Php 调用未定义的函数Mpdf\mb_regex_encoding(),php,yii2-advanced-app,mpdf,Php,Yii2 Advanced App,Mpdf,我想用Yi2 Mpdf生成一些报告,但是当我运行程序时,我遇到了一个错误,比如调用未定义的函数Mpdf\mb_regex_encoding(),请告诉我如何解决这个程序 这是我的控制器 public function actionRpt($id) { $content = $this->renderPartial('rpt', [ 'model' => $this->findModel($id), ]); // s

我想用Yi2 Mpdf生成一些报告,但是当我运行程序时,我遇到了一个错误,比如调用未定义的函数Mpdf\mb_regex_encoding(),请告诉我如何解决这个程序

这是我的控制器

public function actionRpt($id)
{   
    $content = $this->renderPartial('rpt', [
            'model' => $this->findModel($id),
        ]);

    // setup kartik\mpdf\Pdf component
    $pdf = new Pdf([
        // set to use core fonts only
        'mode' => Pdf::MODE_UTF8, 
        // A4 paper format
        'format' => Pdf::FORMAT_A4, 
        // portrait orientation
        'orientation' => Pdf::ORIENT_PORTRAIT, 
        // stream to browser inline
        'destination' => Pdf::DEST_BROWSER, 
        // your html content input
        'content' => $content,  
        // format content from your own css file if needed or use the
        // enhanced bootstrap css built by Krajee for mPDF formatting 
        'cssFile' => '@vendor/kartik-v/yii2-mpdf/assets/kv-mpdf-bootstrap.min.css',
        // any css to be embedded if required
        'cssInline' => '.kv-heading-1{font-size:18px}', 
         // set mPDF properties on the fly
        'options' => ['title' => 'RPT NCR'],
         // call mPDF methods on the fly
        'methods' => [ 
            'SetHeader'=>['NCR'], 
            'SetFooter'=>['{PAGENO}'],
        ]
    ]);
}

您必须启用
mbstring
PHP扩展,包括
mbregex
选项,在某些环境中需要显式启用该选项