473,322 Members | 1,496 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Error creating PDF with PHP library

1 Bit
I am using the fpdf php library to create a PDF file from php

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. require('lib/fpdf.php');
  4.  
  5. $pdf = new FPDF();
  6. $pdf->AddPage();
  7. $pdf->SetFont('Verdana','B',16);
  8. $pdf->Cell(40,10,'Create this pdf now!');
  9. $pdf->Output("new_pdf_file.pdf", "D");
  10.  
  11. ?>
  12.  
I get the following error

This page isn’t working localhost is currently unable to handle this request. HTTP ERROR 500
Feb 2 '21 #1
2 3253
dev7060
633 Expert 512MB
Enable error reporting to see the error(s).
Feb 2 '21 #2
bakertaylor28
45 32bit
The problem is that FPDF requires you to enable http PUT method in the affected directories on the server, in able to serve the PDF file directly to the client browser. In the case of Apache, this would be done in apache2.conf file.

The workaround would be to use Output ("/path/to/file.pdf" "F") and then include a header redirect to /path/to/file.pdf, or to use Output(); which is Output("""I") by default. Also, the Path in the Output command needs to be a full path that is writable.
Feb 25 '21 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Xavier MT | last post by:
Hi, I have a problem if somebody can help I appreciate it My VS.NET seemed to work fine and all of a sudden I started to get the "error creating control message" In my aspx page I drag a...
6
by: owen | last post by:
Generally speaking, what does it mean when I see a "button" with red text showing this message instead of the control I've dragged onto the web form in Design View.? (But the page works fine at...
4
by: Altramagnus | last post by:
I have 30 - 40 type of different window. For each type I need about 20 instances of the window. When I try to create them, I get "Error creating window handle" My guess is there is a maximum...
0
by: Matt Warner | last post by:
Hi guys, A couple of people have already posted questions about similar issues but haven't had any response. Occasionally, sometimes after running the app for a few hours, it bombs out saying...
6
by: DraguVaso | last post by:
Hi, In my application, on some given actions while debugging in Visual Studio, I suddenly get a "System.ComponentModel.Win32Exception was unhandled" Message="Error creating window handle."...
3
by: J | last post by:
Hi, I have setup a test server with the following installed: 1) Windoes Server 2003 - Latest SPs applied. 2) Ms_SQL Server 2000 - Latest SPs applied 3) Visual Studio 2003 I have Admin...
0
by: Ravi Ambros Wallau | last post by:
Hi: I've created a custom control - a grid that uses Infragistics to display some filters, the grid itself, and some buttons. Well, when using this control directly on WebForm, everything works...
4
by: =?Utf-8?B?Z3JlZw==?= | last post by:
I am trying to create an instance of a 3rd party COM component, and I'm getting an error. I've opened a ticket with this vendor as well, but I want to approach it from the C# .NET side to make...
1
by: xuki | last post by:
Hi every one! I need your help to solve this problems. I'm trying to creat a wsdl file to a webservice but i'm getting an erros. "Error creating WSDL document:Error creating WSDL: no class...
1
by: timothy980i | last post by:
Hi i got this error help Error: Error creating database: Access denied for user ''@'localhost' to database 'mydb' The code is: <html> <body>
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.