Class "DOMDocument" not found

I installed invoice ninja on my nginx ubuntu server following this tutorial:

Everything works and I created the admin account, after that I got redirected to the login page.

The log in storage/logs says:

[2022-08-30 22:27:27] production.ERROR: Class "DOMDocument" not found {"exception":"[object] (Error(code: 0): Class \"DOMDocument\" not found at /var/www/invoiceninja/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php:95)

I tried installing php8.0-xml many times with apt and its working and already satisfied.
I restarted / stopped and started nginx after that but nothing works.

People in the web are saying I have to reload composer but I dont use composer.

What version of InvoiceNinja have you installed? (Anything after v5.4.12 requires php8.1; php8.0-xml won’t be enough.) Also, installing multiple versions of php often leads to confusion.

How can I check my InvoiceNinja version?

I also have installed the 8.1 version, but possibly all other versions aswell, how can I deinstall them?

Thanks for your help


ensure you have all the extensions required:

I did that with no errors, how can I see if the log is still the latest. Maybe I dont have this error anymore because the log is showing an error from yesterday


With this error no PDFs would generate… so i would suggest clearing the logs and then watch for any additional errors.