简体   繁体   中英

View [index] not found in Laravel 5.4 Production

I'm having issues with a laravel 5.4 app deployed on shared hosting. I'm getting the error

(1/1) InvalidArgumentException View [index] not found.

in FileViewFinder.php (line 137) at FileViewFinder->findInPaths('index', array('D:\\wamp64\\www\\oagc\\resources\\views')) in FileViewFinder.php (line 79)

This is what I have done so far

  1. Clear routes in development server (my laptop) 在此处输入图片说明 在此处输入图片说明

  2. Moved all folders and files in my app root folder except public folder to /home/tmworkxc/oagc 在此处输入图片说明

  3. Moved all folders and files in app public folder to public_html/oagconsult.ng folder 在此处输入图片说明

  4. Edited public_html/oagconsult.ng/index.php

    require __DIR__.'/../../oagc/bootstrap/autoload.php';

    $app = require_once __DIR__.'/../../oagc/bootstrap/app.php';

Did I miss anything that is causing the error?

Closures cannot be serialized, therefore your route which uses a closure (anonymous function) cannot be cached.

Check this code to see my point: https://3v4l.org/BcVJi

$x = function(){return 'whatever';};
serialize($x);

Resolved the issue running the command php artisan config:clear . I have no idea why php artisan config:cache did not work but i'll update my answer when i find out the reason.

Just delete all files in the bootstrap/cache folder of the server. Now the server will not use the cache of the localhost.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM