Trouble Getting started intalled on Ubuntu 18.04 "Whoops"

I just got all new equipment… server, firewall, etc. I had invoice ninja installed on a Ubuntu 16.04 LTS box and working fine for a long time. I just upgraded all my equipment and did a fresh install of InvoiceNinja using the setup instructions from https://websiteforstudents.com/install-invoice-ninja-on-ubuntu-16-04-18-04-lts-with-nginx-mariadb-and-php-7-2-fpm/

Now when I try to hit the site I get “Whoops, looks like something went wrong.” with a little ghost that says “Exception!”

NOT a lot to go on? Anyone have any ideas? My Linux skills are on the lower side of mediocre so be easy on me.

Thanks,
Chris

Check /ninja/storage/logs/laravel-error.log. If you get the “Whoops, looks like something went wrong.” there’s usually a entry in there.

The logs folder is empty.

Could be a permission issue. What do you get when you run stat -c "%U:%G" /var/www/html/invoiceninja/storage/?

root:root

That’s probably why, then. The webserver has no permissions to write to the directories beacuse the root user is the owner, so the webserver can’t really do anything.

chown -R www-data:www-data /var/www/html/invoiceninja/ will assign ownership of the entire invoiceninja/ directory (and anything inside that) both the www-data user, and the www-data group (your nginx server).

After that, just to be sure the correct read/write/execute permissions are set, do sudo chmod -R 775 /var/www/html/invoiceninja/, and that will assign read, write, and execute permissions to the www-data user and group, and read+execute to the rest of the system.

Yeah I ran those commands during installation.
I ran them again as su now the stat command returns www-data:www-data
instead of root:root but still no luck. I’ll the logs are working now.

[2018-12-31 05:37:38] production.ERROR: Doctrine\DBAL\Driver\PDOException [1698] : /var/www/html/invoiceninja/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOCo$

Well, that gets us closer to a solution. It looks like PHP might be missing a module needed to connect to the database. Try php -m and see if “pdo_mysql” is listed. If not, you can install it with sudo apt install php-mysql (don’t worry, MariaDB is a drop-in replacement for MySQL, so the module should still work). Then restart the webserver with sudo service nginx restart, and for good measure, sudo service php-fpm restart.

It is there. Should I try reinstalling it anyway?

If it’s there, then that won’t be the problem. Run php -m again and also look for dom, exif, gd, gmp, mbstring, mysql, SimpleXML, wddx, xml, xmlreader, xmlwriter, xsl, and zip.

chris@server1:~$ php -m
[PHP Modules]
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

I tried restarting the service php-fpm and got the following

chris@server1:~$ sudo service php-fpm restart
Failed to restart php-fpm.service: Unit php-fpm.service not found.

looked up the service… it was actually php7.2-fpm. So that’s not anything.

That was just making sure nginx and the php service got restarted. In a pinch, a complete reboot would have done the same thing.

Thanks for all your help. I ended up deleting and creating a new database file and it started working. Not sure what happened. But it’s up and working perfectly.

Thanks again!