Support the ongoing development of →
Configuration Laravel
Last updated 2 years ago.

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?

christopherh0rn liked this reply


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/

pokurivijay liked this reply


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

christopherh0rn liked this reply


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.


Maybe clean the views, routes cache.


   composer dump-autoload


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

Sadly @sangrialdrete that didn't help.


The solution was to run php artisan extension:autoload

Many thanks everyone for their help.


Sign in to participate in this thread!


Your banner here too?

Chris christopherh0rn Joined 16 Jan 2020


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

Your logo here?

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

© 2024 - All rights reserved.