I'm making a website in PHP in which I m using the DOMPDF. I have the same website hosted on two servers one is shared and other is VPS(centos). DomPDF is working fine on shared hosting but showing blank white page in vps server here is my code
require_once("admin/dompdf/autoload.inc.php");
echo "<pre>" ; print_r(__DIR__ ); echo " 1 </pre>";
use Dompdf\Dompdf;
echo "<pre>" ; print_r(__DIR__ ); echo " 2 </pre>";
$dompdf = new Dompdf();
echo "<pre>" ; print_r(__DIR__ ); echo " 3 </pre>";
$dompdf->loadHtml($template);
$dompdf->setPaper('A4','landscape');
$dompdf->render();
$dompdf->stream();
I tried to echo. working fine till echo 2 but echo 3 is not displaying means the problem is in line $dompdf = new Dompdf();
You can check the requirements for DomPDF here: https://github.com/dompdf/dompdf/wiki/Requirements
You are probably missing one of the required extensions. (MBString or GD)
You can check your enabled modules with the php -m
command.
Also check this question: How to check which PHP extensions have been enabled/disabled in Ubuntu Linux 12.04 LTS?