PDF issue - throws 500 error (Arch Linux)

Invoice Ninja: v5.1.8
PHP version: v8.0.2

I appreciate that Arch is not a “supported” distro but it makes for a brilliant OS on a VPS as it is small, quick and, being a rolling release OS, never requires a re-build of the VPS every time there is a major new OS update (like Ubuntu, CentOS etc). My company is moving all our servers to Arch for this reason and because we all use Arch on our desktops in the office. InvoiceNinja is the only Laravelle app I’m struggling to migrate.

Once I get this working I propose to create a package and submit it to Arch AUR (the current one is way out of date and doesn’t work). So all help to get this resolved gratefully received!

I have a working version of 4.5.3 on our Ubuntu VPS but it is being decommissioned within the next 4 weeks so I’m on the clock :wink:

I’ve installed 5.1.8 on the Arch server and have successfully migrated from our v4 server without any apparent errors. But PDF generation refuses to work - the setup was OK and the test PDF produced, and I’ve manually run snappdf from the app folder and generated a PDF of “Hello World” but inside the app when trying to either create and invoice or create a new invoice style I get 500 server errors with

production.ERROR: Required parameter $field follows optional parameter $custom_fields {“userId”:1,“exception”:"[object] (ErrorException(code: 0): Required parameter $field follows optional parameter $custom_fields at /srv/http/hosts/invoiceninja/app/Utils/Helpers.php:52)

as the error message.

As a check, I dropped all the tables and rebuilt them using artisan. I then used the dummy company (without migrating our live data) to rule out something being wonky with the migration process. Same result and error message.

Any ideas what I can try to get this to work? I’d prefer not to downgrade PHP as v8 is required for another app.

TIA

Hey there, thanks for submitting this.

I appreciate that Arch is not a “supported” distro but it makes for a brilliant.

Can you please reference, where you read this? As far as I know, Arch should be supported just fine, no reason not to.

Next, if the PDF generation works from the command line, that’s good. Looks like there’s a bug in our app, regarding php80.

At the moment php80 isn’t supported (one of our main dependencies isn’t up-to-date). I know this really sucks, but that’s what we have to deal with at the moment.

Until we get up & going with php80, I suggest you install version 5 using Docker. Thanks.

Thanks for responding Ben.

I put “supported” in quotes because I’d not seen anything official either way but every self-host tutorial I’ve come across has been for CentOS or Debian/Ubuntu. I’m keen to help support and promote Arch as Invoice Ninja was the easiest install I’ve done to date - all I needed to add was the php-gd package to get everything up and running.

I’ve not used Docker before so I’ll look at that. Also, as a fallback, is it possible to tell Invoice Ninja to use a specific version of PHP if I installed 7.4 alongside 8.0?

With respect to PHP8, feel free to ask me to test stuff as I’ll keep the existing setup on the server

Feel free to put some guide on installing Invoice Ninja on the forum & we’ll gladly list it in our docs! (you can pull request the update yourself, also).

Install guides written for CentOS & Ubuntu are community-created, so Arch would be accepted open-handed!

You can install multiple PHPs. I’ve used Arch myself, php74 or other (from AUR) will land into /usr/local/bin/php74 or /usr/bin/php74. All you have to do is tell Nginx to use that php-fpm & I think that should be more or less it.

@david might have some advice, he’s our devops expert here. Thanks!

As @ben mentioned, it is possible to setup multiple different PHP runtimes and then target which ever you need.

We are waiting for one package to include PHP 8 support and then we can also include that in the supported list of runtimes.