PHP Fatal error: require()

Hi,

Just installed Invoice Ninja on Ubuntu 18 server with Apache and mySQL. The server is on the local network and I’m using its IP address rather than a domain name. Invoice Ninja installed via git clone. I configured everything according to the installation guide but I get a HTTP Error 500 when pointing my browser at invoiceninja/public/. My Apache error log shows :


Sat Feb 09 15:15:54.937553 2019] [php7:warn] [pid 23654] [client 192.168.2.101:59077] PHP Warning:  require(/var/www/html/invoiceninja/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /var/www/html/invoiceninja/bootstrap/autoload.php on line 20
[Sat Feb 09 15:15:54.937664 2019] [php7:error] [pid 23654] [client 192.168.2.101:59077] PHP Fatal error:  require(): Failed opening required '/var/www/html/invoiceninja/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php') in /var/www/html/invoiceninja/bootstrap/autoload.php on line 20

Having read some other posts on the forum I think there might be something wrong with my virtual hosts file but I’m not that familiar with how they work. Here it is :


<VirtualHost *:80>
   ServerAdmin admin@elocalhost
   ServerAlias 192.168.2.113
   DocumentRoot /var/www/html/invoiceninja/public

     <Directory /var/www/html/invoiceninja/public>
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
     </Directory>

     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Can anyone make any suggestions?

Kind regards

If you’re using git you need to run composer install.

This step isn’t need if you use the self host zip.

Thanks Hillel,

I managed to miss that step step when following the instructions in the detailed guide. I’ve now run composer install but have come up against another problem. I now get a 404 error when navigating to invoiceninja/public/ :

The requested URL /invoiceninja/public/setup was not found on this server.

Any ideas?

On another note, what is the download url for the latest version that I can use with wget on my server?

If you’re seeing a 404 it could be a web server misconfiguration.

The latest version can be downloaded at https://download.invoiceninja.com

Thanks,

The only configuration changes I have made to Apache is adding the virtual hosts file as above. Is’s a fresh install of Ubuntu Server 18.04 otherwise.

If I go to I 192.168.2.113/ I just get the Apache Ubuntu default page. This implies that my virtual hosts file is not configured properly. Shouldn’t it be directing me to the invoiceninja setup page?

If you’re using a virtual host you should map the web root to the /public folder which would make the URL /invoiceninja/setup

OK, thanks. Is it necessary to use a virtual hosts file? There is going to be nothing else on this server.

I think it’s possible without it but I think it’s considered the best practice

Managed to get it working, I set my virtual hosts file to simply :

<Directory /var/www/html/ninja/public>
    Options +FollowSymlinks
    AllowOverride All
    Require all granted
</Directory>

I know this is not the ideal solution but I don’t know a lot about setting up web servers properly. At least I can try out InvoiceNinjna now. It’s looking great so far, keep up the hard work, developers!

Glad to hear it’s working!