+ 1

Problem with localhost Path, XAMPP and TCPDF

Hi all, I use TCPDF to generate a PDF in PHP. When I use the $pdf->Output($file_total, 'I'); its all good and the file is shown in Browser. If I use the save to localhost option $pdf->Output($file_total, 'F'); I get this error: "failed to open stream: Permission denied in /opt/lampp/htdocs/project/tcpdf_min/include/tcpdf_static.php on line 1821" "TCPDF ERROR: Unable to create output file" The Path I set for saving the PDF file is: "/opt/lampp/htdocs/project/files/2021" What am I doing wrong? is my path wrong? Thanks

27th Nov 2021, 7:53 PM
pap
pap - avatar
6 odpowiedzi
+ 1
Ok, so here is the answer. There were two mistakes: 1) the path: on mac the path to xampp/lampp folder is “http://localhost:8080/name_of_your_folder_in_htdocs…” 2) the problem with tcpdf not able to generate output was because all folders in xampp/lampp were by default read only. So i just had to change the permissions of all folders to “everyone - read AND write”. So thats it
28th Nov 2021, 8:11 PM
pap
pap - avatar
+ 1
$pdf->Output($_SERVER['DOCUMENT_ROOT'] . 'output.pdf', 'F'); ?
27th Nov 2021, 9:25 PM
Alexey Kopyshev
Alexey Kopyshev - avatar
+ 1
have you checked the folder permissions? I don't really have any more ideas
28th Nov 2021, 8:19 PM
Alexey Kopyshev
Alexey Kopyshev - avatar
+ 1
Alexey Kopyshev i did and that was the part 2 of the problem. Thanks man. Now its solved
28th Nov 2021, 8:20 PM
pap
pap - avatar
0
Alexey Kopyshev, it's not working for me. I just add the path as "/opt/lampp/htdocs" and then I still get the error: Warning: fopen(file:///opt/lampp/htdocs/output.pdf): failed to open stream: Permission denied in /opt/lampp/htdocs/project/tcpdf_min/include/tcpdf_static.php on line 1821 TCPDF ERROR: Unable to create output file: /opt/lampp/htdocs/output.pdf Something is wrong with the path... forced save ("D") works, but i need to save the file in particular folder... any ideas?!
28th Nov 2021, 7:15 PM
pap
pap - avatar
0
Alexey Kopyshev so im the half way throug it - the path is “http://locahost:8080/project…” But i still get the error “unable to create output file…” any ideas?!
28th Nov 2021, 7:17 PM
pap
pap - avatar