-4
The following is, I installed mPDF via Composer to develop the localhost project (on the PC). Everything works normally on the machine. I uploaded the VENDOR folder to the hosting, but it’s not generating the PDF. Could someone give me a hint as to what might be going on? The PHP version is 7.2.7.
Error in server log file:
[01-Apr-2019 22:19:44 America/Sao_Paulo] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
[01-Apr-2019 22:19:46 America/Sao_Paulo] PHP Fatal error: Uncaught exception 'Mpdf\MpdfException' with message 'Unable to set PDF file protection, CSPRNG Functions are not available. Use paragonie/random_compat polyfill or upgrade to PHP 7.' in /home/transpomk/public_html/novo-website/sistema/libs/php/vendor/mpdf/mpdf/src/Pdf/Protection/UniqidGenerator.php:11
Stack trace:
#0 /home/transpomk/public_html/novo-website/sistema/libs/php/vendor/mpdf/mpdf/src/ServiceFactory.php(68): Mpdf\Pdf\Protection\UniqidGenerator->__construct()
#1 /home/transpomk/public_html/novo-website/sistema/libs/php/vendor/mpdf/mpdf/src/Mpdf.php(1033): Mpdf\ServiceFactory->getServices(Object(Mpdf\Mpdf), Object(Psr\Log\NullLogger), Array, 0, Object(Mpdf\Language\LanguageToFont), Object(Mpdf\Language\ScriptToLanguage), NULL, NULL, NULL, NULL)
#2 /home/transpomk/public_html/novo-website/sistema/model/CreatePDF_01.php(105): Mpdf\Mpdf->__construct(Array)
#3 /home/transpomk/public_html/novo-website/sistema/control/view-pdf.php(24): CreatePDF_01->solicitacaoPDF(Array)
#4 {main}
thrown in /home/transpomk/public_html/novo-website/sistema/libs/php/vendor/mpdf/mpdf/src/Pdf/Protection/UniqidGenerator.php on line 11
Access your server log file and see what the error message is.
– Woss
Error in the temporary folder permissions, error in the permissions of the class fonts dump directory, permission error in the class cache, error in your code, anyway, can be anything...
– ShutUpMagda
Regarding the code could be a matter of paths and directories, however, I went up the pasture in the same localhost sequence. Permissions may even be...
– Renato Damazio
The error itself already accuses lack of functions
CSPRNG
. And it even suggests a polyfill or upgrade to PHP 7: "Uncaught Exception 'Mpdf Mpdfexception' with message 'Unable to set PDF file Protection, CSPRNG Functions are not available. Use paragonie/random_compat polyfill or upgrade to PHP 7.' in"– LipESprY