I have an error 500 with this code:
require_once FCPATH.'application/helpers/dompdf/dompdf_config.inc.php';
$dompdf = new DOMPDF();
$dompdf->load_html( $html );
$dompdf->render();
$pdf = $dompdf->output();
file_put_contents( './tmp/'.$filename.'.pdf' , $pdf );
With some debug, I find that the "evil" code is this
$dompdf->load_html( $html );
And I don't know how to solve this.
Even the "ini_set" instruction with memory_limit and max_execution_time doesn't fix this problem..
Follow the advice in this SO question. PHP is probably bubbling the error up to Apache.
Check the permissions on the file and parent folders of application/helpers/dompdf/dompdf_config.inc.php
, ensure they are readable.
I believe that if you see a 500 error in the access log, there will also be a report in the error log. If not, the error is coming from PHP. Check your server logs. See /var/log/apache2/error.log
and var/log/apache2/access.log
on Linux.