Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

eriktobben's avatar

New install Laravel 5 - Uncaught exception

Hi!

I am new to Laravel 5, and trying to set it up on Digital Ocean using Serverpilot.

I have installed Composer and installed Laravel through that. I have moved the public folder within Laravel project folder to my server public folder and changed the path in index.php to reflect this.

When I try to request the site in the browser, I get the following message: Fatal error: Uncaught exception 'ReflectionException' with message 'Class log does not exist' in ......

I've searched around, but the other posts where related to after an update. This is a completely new install.

Are there any Laravel-magicians that can help? :)

0 likes
5 replies
phildawson's avatar

I would have thought a change to these paths would be enough in index.php

require __DIR__.'/../bootstrap/autoload.php';
$app = require_once __DIR__.'/../bootstrap/app.php';
eriktobben's avatar

Hi!

Thanks for the reply.

I have done that:

require __DIR__.'/../private/task-mananger/bootstrap/autoload.php';

$app = require_once __DIR__.'/../private/task-mananger/bootstrap/app.php';

My directory is as follows:
1. apps
2. taskdev
3. private
4. task-mananger
5. (Laravel files)

3. public
4. index.php

Still doesn't seem to work..

phildawson's avatar

@eriktobben You may also need to set the public path if its not called public or inside your basepath.

You can see the current path if it's correct with

dd(public_path());

The commented out is what it usually is

app()->bind('path.public', function($app){

    return ...; // $app->basePath().DIRECTORY_SEPARATOR.'public';
});

I'm guessing its set to apps/taskdev/private/task-mananger/public rather than apps/taskdev/public

eriktobben's avatar

When I try to visit index.php after adding dd(public_path()); I get the following error:

Fatal error: Call to undefined function dd() in /srv/users/serverpilot/apps/taskdev/public/index.php on line 3

Where can I put the dd(public_path()); and how do I edit to the right path?

eriktobben's avatar

I figured it out. Or, I tried switching to Laravel Forge, and when executing the composer update / install command, I got information about exceeding memory.

So I upgraded the server and it seems to be installing more data in composer. Not sure what was wrong the first time, as I did not get the memory message then.

But, it works now, and I am ready to dig in to Laravel.

Thanks for help!

Please or to participate in this conversation.