Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fopen(/vendor/dompdf/dompdf/lib/fonts/glyphicons-halflings-normal_c47afe5539ba1b2094563d54dce2def7.ufm): failed to open stream: Permission denied

When generating my PDF with custom fonts and trying to stream like this:

$pdf = PDF::loadView( '/pdfs/invoice',$data); return $pdf->stream();

local environment everything works fine. I can generate the pdf also.

production environment I am getting the error which written on the title.

And I have saved my Font files within storage/fonts and I have added 'storage/fonts' to writable_dirs within deploy.php.

I cannot set permission for every release within vendor files AND also I do not understand why the Font Caching is processed there. It should be done within my storage/fonts, since in config/dompdf.php there.

like image 408
SUGU Avatar asked Sep 05 '25 01:09

SUGU


1 Answers

Change vender permissions

sudo chown -R www-data:www-data website/vendor/
like image 155
Shubham Verma Avatar answered Sep 07 '25 17:09

Shubham Verma