Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel Unable to create directory: /tmp #1012

Open
HashmatWaziri opened this issue Nov 25, 2023 · 4 comments
Open

Laravel Unable to create directory: /tmp #1012

HashmatWaziri opened this issue Nov 25, 2023 · 4 comments

Comments

@HashmatWaziri
Copy link

HashmatWaziri commented Nov 25, 2023

` $pdf = PDF::loadView('education::classes.reports.pdf.student.memorization', $data)->setPaper('a4');

    // Get the current time, but only the hour, minute, and second

    // Define file path and name without the time component

    $filename = "student_memorization_report_{$month}_{$year}.pdf";

    $filePath = storage_path('app/public/reports/' . $filename);



    // Check if a file with the same name already exists, delete if it does

    if (file_exists($filePath)) {

        unlink($filePath);

    }

    $pdf->save($filePath);`

dompdf error

@HashmatWaziri HashmatWaziri changed the title Unable to create directory: /tmp Laravel Unable to create directory: /tmp Nov 25, 2023
@HashmatWaziri
Copy link
Author

@ericvanjohnson @jdavidbakr @zaherg @luke83 , Wanted to follow up on this matter. thanks.

@HashmatWaziri
Copy link
Author

@jdavidbakr @zaherg @luke83 @ericvanjohnson , wanted to follo up on this

@jdavidbakr
Copy link
Contributor

I'm unclear why you tagged me? Looks like it may be a filesystem issue, does the /tmp directory exist in your environment and is it writable by the web service?

@HashmatWaziri
Copy link
Author

HashmatWaziri commented Dec 2, 2023

I appologize if wrongly tagged but yeah it is writable by the web service . I am using ubunto for production. here is the details of the tmp folder :
drwxrwxrwx 11 root root 409600 Dec 2 08:10 tmp
I already changed the root root to the web services one but still got error. Anather point is that I already changed the "temp_dir" => storage_path('app/dompdf_temp'),
of the dompdf but it is not reflected as it keeps giving me that error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants