500s After Install

Hello, I’m having some trouble after install. I’m self-hosting, running in a subdomain (so I’ve turned on RewriteBase / inside of /public/.htaccess).

I was able to get things installed, get a successful connection to my DB, but now once I log in I get a 500 error on the dashboard. I’m trying to install on MediaTemple’s GridServer - just in case that’s somehow relevant.

Here’s my last entry in laravel-error.log:
[2018-03-19 14:32:06] production.ERROR: ***Doctrine\DBAL\Driver\PDOException*** [2002] : /nfs/c12/h08/mnt/217108/domains/billing.reasonspark.com/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php [Line 47] =&gt; SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) {"context":"PHP","user_id":0,"account_id":0,"user_name":"","method":"POST","url":"http://billing.reasonspark.com/setup","previous":"http://billing.reasonspark.com/setup","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36","ip":"66.57.183.10","count":10,"is_console":"no","is_api":"no","db_server":"mysql"} [] <code></code>

And here’s the last entry in my server’s logs:
[Mon Mar 19 13:54:50 2018] [warn] [client 162.158.78.196] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server, referer: http://billing.reasonspark.com/login [Mon Mar 19 13:54:50 2018] [error] [client 162.158.78.196] Premature end of script headers: index.php, referer: http://billing.reasonspark.com/login <code></code>

Any help or a pointer in the right direction would be very much appreciated - I’ve been banging my head against this for a few days now. Thanks in advance!

One follow-on question about install: my webhost uses a folder called html as the web root. I currently have the entirety of the InvoiceNinja install inside my web root.

Should I instead drop the contents of /public inside my webroot (called /html), and let the rest of the installation files live above my webroot? The instructions don’t reference this, but on a few forum posts I’ve seen users talk about this scenario. Would this install pattern fix my issue?

The first error indicates that the app can’t reach your MySQL server, you’ll need to raise this with your host and ensure the relevant MySQL server is install as well as the php-mysql extension.

In regards to webroot path, it all depending on the hosting architecture, ultimately you need your document path for apache/nginx to be configured so that /public is where the webserver will look for index.php

Thanks @DavidBomba for the quick reply. The strange thing of it is, on the setup screen I get a success message when trying to connect to MySQL, and I run Wordpress and other installs on this server with no other issues.

That is weird, if you have php-mysql installed, it should ‘just work’

To close the loop on this, it turns out I didn’t catch every instance of my document root mapping. Once I was able to properly and fully move my document root to …/ninja/public/ everything started working for me.