barryvdh / laravel-dompdf

A DOMPDF Wrapper for Laravel
MIT License
6.57k stars 965 forks source link

File(/.ufm) is not within the allowed path(s) #1032

Open alin09ro opened 5 months ago

alin09ro commented 5 months ago

Error loading PDF: file_exists(): open_basedir restriction in effect. File(/.ufm) is not within the allowed path(s): (/home/arcareso:/opt/cpanel/ea-php82:/var/cpanel/php/sessions/ea-php82:/tmp:/home/arcareso/secure.arcaromania.ro/storage)

I have tried everything: setting full permisions, changing the paths in the config, nothing works! the paths are in open_basedir. What else should I check?

can someone help?

parallels999 commented 5 months ago

/home/arcareso:/opt/cpanel/ea-php82:/var/cpane It seems to me that it should be separated by ;, it also restarts the service

alin09ro commented 5 months ago

these are the locations from open_basedir. i have websites on 3 different servers and all the open_basedir locations are enumerated the same ( without ;)

"Under Windows, separate the directories with a semicolon. On all other systems, separate the directories with a colon." (from the php docs)

jose123v commented 5 months ago

Did you try adding /.ufm to open_basedir config?

alin09ro commented 5 months ago

tried that, no success. but i found that if i add ->setOptions(['defaultFont' => 'sans-serif']); to the pdf generator line it works, so i think it's a issue related to fonts or fonts location (i tried to modify the default font in the config but nothing changes)

russellobrio commented 4 months ago

Encountering the same issue, I also am using custom font and there are files generated in fonts cache but this still shows this error

jose123v commented 4 months ago

Feel free to open a PR fixing it

NacerKH commented 4 months ago

I make a PR to fix this issue on dompdf

https://github.com/dompdf/dompdf/pull/3415

This issue must be solved when the PR will be accepted.

chrisschale commented 2 months ago

I have the same issue and this thread saved my day .. i hope they will accept the PR soon. @alin09ro how do you use ->setOptions(['defaultFont' => 'sans-serif'])? Can you give a full example?