Reputation: 41
I am using Dompdf (v-0.8.2) to generate pdf on the server-side. My server is NGINX and I am using CodeIgniter 2.41 (PHP framework) for PDF generation. PDF is being generated in the localhost without any errors whatsoever. But when I try to generate the same pdf on the server side it gives this error,
[error] 31558#31558: *4 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error:
Call to undefined function Dompdf\mb_internal_encoding() in
/application/libraries/dompdf/src/Dompdf.php:274
Stack trace:
#0 /application/libraries/Pdf.php(17): Dompdf\Dompdf->__construct()
#1 /system/core/Loader.php(1100): Pdf->__construct()
#2 /system/core/Loader.php(976): CI_Loader->_ci_init_class('pdf', '',
NULL, NULL)
#3 /system/core/Loader.php(217): CI_Loader->_ci_load_class('Pdf', NULL,
NULL)
#4 /application/third_party/HMVC/Loader.php(138): CI_Loader-
>library('pdf', NULL, NULL)
I tried upgrading my dompdf version to 0.8.5. but still the error is not resolving. Does anyone have an idea of how to resolve the error.
Thank you in advance, cheers. :)
Upvotes: 0
Views: 436
Reputation: 579
mbstring is a "non-default" extension, that is not enabled by default ;
try to install or enabled mbstring extension
sudo apt-get install php(version)-mbstring
ex.: sudo apt-get install php7.3-mbstring
for enabling extension use sudo phpenmod mbstring
Upvotes: 3