Answers.Body: <p>Generating a pdf can take a lot of memory and time. If you can turn of the PDF option, that should skip the problem, as Laryn suggested try to turn if off, at least to be sure it's the root problem.</p>
  
  <p>But ff it really takes a lot of time (300 sec is a lot) it might be that you changed the layout of the pdf and/or include too many heavy things (like a huge heavy image for your logo?)</p>
  
  <p>If you do need complex/heavy pdf, one workaround is to let civi delegate the hard work of generating that pdf to an external program. Check if your hosting provider can install wkhtmltopdf and under Admin/system settings/misc put the path of that program into "Path to wkhtmltopdf executable"</p>
  
  <p>I use it for instances that need to generate loads of complex pdfs, the default civi way should work fine for "simple" pdf, it's likely you have something in your setting that is an issue (either faulty pdf layout if you customised it, non optimised images or something)</p>
  
  <p>X+</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-11T22:34:44.233Z
Answers.Text: I concur. I found that I was unable to generate almost all pdfs. Switching to wkhtmltopdf solved the problem for me in every instance. I haven't run into a downside.
Answers.UserDisplayName: kapn
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-12T10:16:26.823Z
Answers.Text: @Xavier - Thanks. I will see if host can install wkhtmltopdf for me. Thanks also to Keith Nunn
Answers.UserDisplayName: Steven James
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-11T08:23:09.570Z
Answers.LastActivityDate: 2019-10-11T08:23:09.570Z
Answers.UserDisplayName: Xavier
Body: <p>Environment: shared hosting (LAMP), CiviCRM 5.18.2, Backdrop 1.14, PHP 7.2.23
  When invoicing is enabled (pay later, no payment processor), event registration times out after confirmation screen is confirmed by user. No final confirmation/thank you screen shown, or email sent with pdf invoice.
  PDF extension selected in CPanel PHP Selector > Extensions though throws same error if not selected; PHP timeout extended to 120 seconds, though this does not seem to override host settings (cannot restart Apache after changing).
  Error message:
  "[09-Oct-2019 23:57:10 Europe/London] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in ~/modules/civicrm/vendor/dompdf/dompdf/src/FrameDecorator/Block.php on line 193" Any thoughts gratefully received.
  Disabling invoicing allows registration, and confirmation email sent with pdf invoice with no invoice number, just no contribution record or ability to generate copy invoice etc.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-10T09:45:16.443Z
Comments.Text: Update: host has increased PHP timeout to 300 sec. No improvement.
Comments.UserDisplayName: Steven James
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-11T03:36:13.197Z
Comments.Text: If you turn off the PDF option does it work as you'd expect?
Comments.UserDisplayName: Laryn
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-11T09:07:36.377Z
Comments.Text: does it include any images with biz size? if yes, reduce image size into KB.
Comments.UserDisplayName: Sunil Pawar
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-12T10:12:11.083Z
Comments.Text: @Laryn-CEDC.org: 'automatically include invoice...' switch on Admin>CiviContribute>CiviContribute Component Settings makes no difference. Works as expected when 'Enable Tax and Invoicing' is NOT selected.
Comments.UserDisplayName: Steven James
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-12T10:12:56.787Z
Comments.Text: @SunilPawar: No graphics in pdf - CiviCRM invoice template only with Civi logo removed.
Comments.UserDisplayName: Steven James
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-12T10:18:59.460Z
Comments.Text: Update: So that I can have something up that works for now, have set up another site reverting to D7/Civi for Drupal; works as expected. Keeping Backdrop site live to see if I can sort this out (with assistance from here most gratefully received if any further contributions can be made).
Comments.UserDisplayName: Steven James
Tags: <pdf><invoice><backdrop>
Title: Event registration times out with invoicing enabled
ThreadText: # Event registration times out with invoicing enabled
  
  (Asked by: username_0 on 2019-10-09)
  
  Environment: shared hosting (LAMP), CiviCRM 5.18.2, Backdrop 1.14, PHP 7.2.23
  When invoicing is enabled (pay later, no payment processor), event registration times out after confirmation screen is confirmed by user. No final confirmation/thank you screen shown, or email sent with pdf invoice.
  PDF extension selected in CPanel PHP Selector > Extensions though throws same error if not selected; PHP timeout extended to 120 seconds, though this does not seem to override host settings (cannot restart Apache after changing).
  Error message:
  "[09-Oct-2019 23:57:10 Europe/London] PHP Fatal error: Maximum execution time of 30 seconds exceeded in ~/modules/civicrm/vendor/dompdf/dompdf/src/FrameDecorator/Block.php on line 193" Any thoughts gratefully received.
  Disabling invoicing allows registration, and confirmation email sent with pdf invoice with no invoice number, just no contribution record or ability to generate copy invoice etc.
  
  **Tags:** pdf, invoice, backdrop
  
  > **Comments:**
  > **username_0**: Update: host has increased PHP timeout to 300 sec. No improvement.  
  > **username_1**: If you turn off the PDF option does it work as you'd expect?  
  > **username_2**: does it include any images with biz size? if yes, reduce image size into KB.  
  > **username_0**: @username_1-CEDC.org: 'automatically include invoice...' switch on Admin>CiviContribute>CiviContribute Component Settings makes no difference. Works as expected when 'Enable Tax and Invoicing' is NOT selected.  
  > **username_0**: @username_2: No graphics in pdf - CiviCRM invoice template only with Civi logo removed.  
  > **username_0**: Update: So that I can have something up that works for now, have set up another site reverting to D7/Civi for Drupal; works as expected. Keeping Backdrop site live to see if I can sort this out (with assistance from here most gratefully received if any further contributions can be made).  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2019-10-11. Score: 1
  
  Generating a pdf can take a lot of memory and time. If you can turn of the PDF option, that should skip the problem, as username_1 suggested try to turn if off, at least to be sure it's the root problem.
  
  But ff it really takes a lot of time (300 sec is a lot) it might be that you changed the layout of the pdf and/or include too many heavy things (like a huge heavy image for your logo?)
  
  If you do need complex/heavy pdf, one workaround is to let civi delegate the hard work of generating that pdf to an external program. Check if your hosting provider can install wkhtmltopdf and under Admin/system settings/misc put the path of that program into "Path to wkhtmltopdf executable"
  
  I use it for instances that need to generate loads of complex pdfs, the default civi way should work fine for "simple" pdf, it's likely you have something in your setting that is an issue (either faulty pdf layout if you customised it, non optimised images or something)
  
  X+
  
  > **Comments:**
  > **username_4**: I concur. I found that I was unable to generate almost all pdfs. Switching to wkhtmltopdf solved the problem for me in every instance. I haven't run into a downside.  
  > **username_0**: @username_3 - Thanks. I will see if host can install wkhtmltopdf for me. Thanks also to Keith Nunn  
  
  ---
  
  