Support the ongoing development of Laravel.io →
Configuration Laravel
Last updated 7 months ago.
0

You should remove the app key from this post.

Is the mod_rewrite module and mod_negotiation module enabled for apache? Are you pointing to the public folder of the laravel install (laravel/public) or just to the root path (laravel/)

Can you list a snippet of the routes/web.php file?

1

Thanks for the app key heads up, removed.

Mod_rewrite and mod_negotiation are both enabled. My apache virtualhost config is pointing to the public_html directory. Looking at how the site is set up, there is an override of publicPath() in app/Application.php that is as follows: public function publicPath() { return $this->basePath.'/../public_html'; } This doesn't appear to be working in my local setup, any ideas why?

The routes appear to be generated in subdirectories of laravel/extensions/

1

So it sounds like this is an older version of Laravel. Can you check the composer.json file and see what the laravel/framework or laravel/laravel number shows?

I'm not terribly familiar with anything before 5.3 but you may be able to run that redirect conditionally.

Something like

public function publicPath() {
    if ( config('app.env') == "production" ) {
        return $this->basePath.'/../public_html';
    } else {
        // run whatever code is default
    }
}
1

The laravel/framework is listed as "5.4.*".

The directory structure is identical to the one on the production server so I'm not sure why the publicPath override is working there and not here.

0

Maybe clean the views, routes cache.

Run

   composer dump-autoload

Run

    php artisan cache:clear
    php artisan view:clear 
    php artisan route:clear
    php artisan config:clear
Last updated 2 years ago.
0

Sadly @sangrialdrete that didn't help.

0

The solution was to run php artisan extension:autoload

Many thanks everyone for their help.

0

Sign in to participate in this thread!

Cloudways

Your banner here too?

Chris christopherh0rn Joined 16 Jan 2020

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.