niklasravnsborg / laravel-pdf

📄 Laravel PDF
708 stars 212 forks source link

Temporary files directory is not writable #184

Open Padi-dev-hoangdv opened 4 years ago

Padi-dev-hoangdv commented 4 years ago

I have this error on sever. My local working fine. Temporary files directory "../temp/" is not writable in file vendor/mpdf/mpdf/src/Cache.php on line 17. I had publish vendor Please help!

ssarljames commented 3 years ago

I solved my issue by specifying tempDir to a usable temp directory, in my case Im using it on Heroku

In config/pdf.php

<?php

return [
    'mode'                  => 'utf-8',
    'format'                => 'A4',
    'author'                => '',
    'subject'               => '',
    'keywords'              => '',
    'creator'               => 'Laravel Pdf',
    'display_mode'          => 'fullpage',
    'tempDir'               => base_path('storage/app/mpdf')
];
mohammad-reza-najafi commented 3 years ago

I have same error Temporary files directory "../temp/" is not writable in file vendor/mpdf/mpdf/src/Cache.php on line 17. and set base_path('storage/app/mpdf') not work