Fresh install of v5 Fails to run setup page

I have installed a fresh copy of Invoice Ninja using the Release v5.0.12-release, after going through all of the same steps we used to install older versions we get a screen requesting a login. We are not getting the setup page where we can create a user. We have preformed the steps 3 separate times in fresh machines and get the same result.

How do we get the setup page in this release of Invoice Ninja? How to we create a user to get logged into the system?

We are getting the following Error
Error: please check that Invoice Ninja v5 is installed on the server.invoiceninja-2-error

If we try to navigate to the /setup page we get a 502 Bad Gateway error from NGINX

Are there any errors in the logs ? storage/logs

there are no log files in the directory
[root@invoice storage]# cd logs/
[root@invoice logs]# ls
[root@invoice logs]# ls -al
total 4
drwxr-xr-x 2 nginx nginx 24 Jul 7 05:37 .
drwxr-xr-x 5 nginx nginx 46 Jul 7 05:37 …
-rw-r–r-- 1 nginx nginx 14 Jul 7 05:37 .gitignore
[root@invoice logs]#

A 502 error suggests nginx couldn’t pass the request to PHP, do you have php-fpm setup correctly?

This happens to me when php-fpm isn’t configured properly. systemctl status php-fpm can point you to to root config for php-fpm and help you verify your socket path, and then make sure that socket is setup in nginx.conf appropriately also.

1 Like

Hey Everyone,
I am also experience same issue with v5.0.12-release. I confirm my nginx config looks good + am running this with https.
I have verified my php-fm is running and configured properly.
Kindly please help resolve. Thanks!

I also had that issue, yesterday, and as mentioned by David and Alex, it was caused by wrong config.
In my case it was either: wrong ownership of files or wrong user/group set in php config or incorrect socket path in php and/or nginx config file

1 Like

You may want to upgrade your version of PHP to at least 7.3, preferably 7.4 and try again.

Hey Guys,

Thanks for the reply, I tried to update the php version to 7.4 and also update the socket in nginx config.
But can’t get to the setup portion. It takes directly to login page. Please help!!

My php config in nginx config below:
location ~ /.ht {
deny all;
}
location ~ .php$ {
include snippets/fastcgi-php.conf;
include fastcgi_params;

        fastcgi_pass unix:/run/php/php7.4-fpm.sock;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
    }

Try copying .env.example overtop of .env, without modifications. And re-run php artisan optimize anytime you make changes in this directory.
If you still do not see the setup page, then it is a misconfiguration problem still. Possibly dependencies are not prepared.

It looks like I can see that your php-fpm is still not correctly configured… Are you sure you got php7.4 working properly? This screenshot shows /run/php/php-fpm.sock as a process, but your conf file for nginx shows /run/php/php7.4-fpm.sock.

You need to verify in /etc/php/7.4/fpm/php-fpm.conf that the listen = /path/to/socket line matches.

You also must have the standard php-fpm running since the php7.4-fpm service depends on the main service php-fpm.

php-fpm with multiple versions is also not perfect. For whatever reason, you cannot actually have PHP 7.2 and php7.4 running/installed on the same system with invoiceninja.

Are you trying to run v4 and v5 on the same system? Because this is a technical restriction.

1 Like

Hey @TechnicallyComputers,
I was trying V5 till now, But gave a shot tried to deploy V4.5 and was able to get till setup page.

Now database connection, email setting are successful.
I verified all necessary PHP modules are installed.

Am getting this error in screenshot. I tried this troubleshooting link

As per error message i verified /var/www/invoice-ninja/vendor/symfony/console/Input/ArrayInput.php exist.
Sorry am not very good with codes. Appreciate any help on this.

Thanks.

Run php artisan key:generate from the invoice ninja directory

Then php artisan optimize

OK, I am having the same problem. I (seem to) successfully install V5 and I can get to the login screen, but /setup does not work! I get a 404 error. How do you populate the database if you can’t get into the setup?
My setup:

  • Ubuntu 18.04
  • All PHP 7.4 pre-reqs installed
  • composer run in invoiceninja directory
  • permissions/ownership set as per TC’s instructions
  • php-fm installed and confirmed
  • npm configured
  • .env copied
  • not using docker or git
  • artisan keyed and optimized
  • apache virtual site set up correctly

It seems to be much harder to install v5 than it’s made out in the youtube video. Any advice gratefully received.

@Dr_Strangelove

The 404 here would indicate that the virtual host probably isn’t configured. Do you have mod_rewrite enabled in apache? your .htaccess may also be an issue.

In the video we use Nginx as the webserver which in my opinion is easier to work with than apache.

Mod-rewrite is on .htaccess unchanged:


Options -MultiViews -Indexes

RewriteEngine On

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

I have apache running as I am already running Grafana and Zabbix on this server as well as invoiceninja v4. Apache logs show no errors and I can see no other logs. I have enable debug in .env, but no errors either…

I think your rewrite should have this

RewriteRule ^(.*)$ public/$1 [L]

1 Like