'I Can't generate a PDF in Dompdf due to error 500
I need to generate a pdf file, and I've tried this code in my localhost xampp and it doesn't give me any problem
<?php
ob_start();
echo "hola mundo";
$html=ob_get_clean();
//echo $html;
require_once("../../librerias/dompdf/autoload.inc.php");
// reference the Dompdf namespace
use Dompdf\Dompdf;
// instantiate and use the dompdf class
$dompdf = new Dompdf();
$options=$dompdf->getOptions();
$options->set(array('isRemoteEnabled'=>true));
$dompdf->setOptions($options);
$dompdf->loadHtml($html);
// (Optional) Setup the paper size and orientation
$dompdf->setPaper('letter', 'portrait');
// Render the HTML as PDF
$dompdf->render();
// Output the generated PDF to Browser
$dompdf->stream("nota_de_venta_.pdf",array("Attachment"=>false));
?>
but when I take it to my web server it gives me an HTTP ERROR 500. The same exact code. I realized that the line where the error begins is at.
$dompdf = new Dompdf();
Does anybody know why it could be? I don't have an exclusive web server so I thing I probably won't have access to advance file configurations.
Thanks a lot for your answers.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
