Early in your code you call $dompdf->stream()
. This method streams the PDF and halts execution of the script. I'm not sure why it's working on MAMP but not other servers, but if you re-arrange your script as such you should have more luck.
$dompdf->load_html($html);
$dompdf->set_paper("A4", "landscape");
$dompdf->render();
$canvas = $dompdf->get_canvas();
$font = Font_Metrics::get_font("helvetica", "bold");
$canvas->page_text(750, 570, "Page: {PAGE_NUM} of {PAGE_COUNT}", $font, 6, array(0,0,0));
$canvas->page_text(25, 570, "II International P Ltd", $font, 6, array(0,0,0));
$output = $dompdf->output();
$file_to_save = '../files/'.$projectdetail->project_name.'/'.$projectdetail->project_name.'.pdf';
file_put_contents($file_to_save, $output);
$dompdf->stream($projectdetail->project_name." - Cost Report.pdf", array("Attachment" => false));
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…