I have the latest invoiceplane - 1.4.10 and I have a problem. If I want to “download PDF” (/index.php/invoices/generate_pdf/7) of any invoice, I get 500 Error. I can however generate a PDF of the invoice if I use a “guest preview” (/index.php/guest/view/generate_invoice_pdf/r2eeN2YqXactN31).
Just installed a fresh copy of 1.4.10 and created one client and one invoice to test. I get the blank page for both emailing, downloading, and viewing from guest link. Since it is brand new, I am happy to share the link: https://port8d.com/guest/view/invoice/w4PH0MAZUnlkjGD
Strange thing is that the http headers are returning a status ok / 200, but the page is still blank. I can’t find a 500 error anywhere in my server error logs.
I’m pretty familiar with CodeIgniter, so I’ve been trying to dig around as much as I can. I noticed that in the email routines, successfully sending the invoice is supposed to call the CI redirect function, but the redirect was never firing. I did my best to manually backtrace from there. The wall I finally hit is that the execution cycle dies the moment the new mpdf object is called on line 31 in mpdf_helper.php
"$mpdf = new mPDF();
No errors are returned or logged.
I’ve since downloaded and uploaded a new copy of the mPDF library, but no change in the end result.
I just tested with a manual install in my local environment and everything worked like a charm.
I did use Softaculous to install on my web server, so maybe that was funky. I’m going to wipe it and try a manual install to see if it makes any difference.
Ensure mbregex is enabled as part of mb_string. Apparently this is enabled by default when you enable mbstring in most cases, however with cPanel and some other non-standard environments this might not be the case, so people have to explicitly look for and enable mbregex (i.e. compile PHP with --enable-mbregex.
A Google search for “enable mbstring whm/cpanel” will return helpful instructions to enable it. I am seeing PDF invoices now with no problems!