Home Forums Support PHP Fatal error: require()

This topic contains 9 replies, has 2 voices, and was last updated by  Hillel Coren 1 week, 5 days ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #19214

    hareti
    Participant

    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 [email protected]
       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

    • This topic was modified 1 week, 6 days ago by  hareti.
    #19219

    Hillel Coren
    Keymaster

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

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

    #19240

    hareti
    Participant

    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?

    #19241

    Hillel Coren
    Keymaster

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

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

    #19242

    hareti
    Participant

    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?

    • This reply was modified 1 week, 6 days ago by  hareti.
    #19243

    Hillel Coren
    Keymaster

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

    #19245

    hareti
    Participant

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

    #19246

    Hillel Coren
    Keymaster

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

    #19252

    hareti
    Participant

    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!

    #19254

    Hillel Coren
    Keymaster

    Glad to hear it’s working!

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.

Posted in: