Error 500 After install using nginx on ubuntu 22.04

Hello!

I followed this tutorial: Install Invoice Ninja v5.5 on Ubuntu 22.04

However, after install, we get an error 500 nothing in the error logs. I’m honestly stuck on what to do.

Hi,

What are the details for the 500 error?

Details as in? Sorry I"m a little confused

The details about the 500 error from the logs in storage/logs or the web server error logs

Get the same problem.

Blockquote
root@ninja:/usr/share/nginx/invoiceninja# sudo tail -f /var/log/nginx/ininja.error.log
#0 {main}
thrown in /usr/share/nginx/invoiceninja/public/index.php on line 26" while reading response header from upstream, client: 192.168.20.4, server: invoice.surpied.com, request: “GET /setup HTTP/2.0”, upstream: “fastcgi://unix:/run/php/php8.1-fpm.sock:”, host: “invoice.surpied.com
2023/07/24 14:39:02 [error] 27794#27794: *11 FastCGI sent in stderr: “PHP message: PHP Warning: require(/usr/share/nginx/invoiceninja/public/…/vendor/autoload.php): Failed to open stream: No such file or directory in /usr/share/nginx/invoiceninja/public/index.php on line 26PHP message: PHP Fatal error: Uncaught Error: Failed opening required ‘/usr/share/nginx/invoiceninja/public/…/vendor/autoload.php’ (include_path=‘.:/usr/share/php’) in /usr/share/nginx/invoiceninja/public/index.php:26
Stack trace:
#0 {main}
thrown in /usr/share/nginx/invoiceninja/public/index.php on line 26” while reading response header from upstream, client: 192.168.20.4, server: invoice.surpied.com, request: “GET /setup HTTP/2.0”, upstream: “fastcgi://unix:/run/php/php8.1-fpm.sock:”, host: “invoice.surpied.com
2023/07/24 14:39:02 [error] 27794#27794: *11 FastCGI sent in stderr: “PHP message: PHP Warning: require(/usr/share/nginx/invoiceninja/public/…/vendor/autoload.php): Failed to open stream: No such file or directory in /usr/share/nginx/invoiceninja/public/index.php on line 26PHP message: PHP Fatal error: Uncaught Error: Failed opening required ‘/usr/share/nginx/invoiceninja/public/…/vendor/autoload.php’ (include_path=‘.:/usr/share/php’) in /usr/share/nginx/invoiceninja/public/index.php:26
Stack trace:
#0 {main}
thrown in /usr/share/nginx/invoiceninja/public/index.php on line 26” while reading response header from upstream, client: 192.168.20.4, server: invoice.surpied.com, request: “GET /setup HTTP/2.0”, upstream: “fastcgi://unix:/run/php/php8.1-fpm.sock:”, host: “invoice.surpied.com

How did you install the app, using the release zip or checking out the code from Github?

Used the zip from the Github site …
Did not locate any other source.
Where can I get the release zip ?

The release zip is available here:

Thank you very much.
Replacing the code from Github with the release version did it!
Thanks.

P.S. you might want to update the post: Install Invoice Ninja v5.5 on Ubuntu 22.04
to reflect the suggestion from David:

I’m not sure what is going on, but is looks like you are injecting the vhost config direct into the main conf file.

Best practice would be to setup a vhost file in

/etc/nginx/sites-available/ninja.conf