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

mecjos's avatar

View Not Found Error on Shared Server (FileViewFinder.php)

Hi. I'm trying to deploy my laravel app and spa onto shared server.. I changed directory path in index.php file according to my app folder. And all my web routes go to landing.blade.php as follows.

Route::get('/{any}', function () {
    return view('landing');
})->where('any', '.*');

and this landing.blade.php file is in resource/veiws location as it must be. Before deploy I performed pre deployment steps on laravel doc's page. Cleaned cache, route and config..

When I open production page it gives following error..

....../vendor/laravel/framework/src/Illuminate/View/FileViewFinder.php (line 137)

why it can't find view file ??

0 likes
10 replies
Sinnbeck's avatar

What is the exact error? You just show a path to a file?

jlrdw's avatar

@mecjos See the deployment chapter, and make sure to point to public as document root. Public can have a custom name.

Normally on shared, public becomes public_html and main laravel goes above web.

@snapey has a couple of guides on this.

https://laracasts.com/discuss/channels/general-discussion/what-is-the-process-to-upload-my-app-to-a-shared-server

https://laracasts.com/discuss/channels/servers/laravel-8-on-shared-hosting-server-in-subfolder?signup

I don't have link to his latest guide.

Sinnbeck's avatar

@mecjos ok did you change anything in laravel to get it working in shared hosting?

mecjos's avatar

@Sinnbeck no, just made optimizations as described on deployment section of doc.

mecjos's avatar

@jlrdw what does it mean. ?? I uploaded public folder into public_htm folder and rest of files into a new folder in main dır. and changed bootstrap and autloader path in index.php according to new path.

jlrdw's avatar

@mecjos apache or nginx? And did you change public to public_htm? Or you sure it's not public_html?

Edit:

Somehow in @snapey example, he mentions renaming public_html to public and a symbolic link. I am trying to find the post where he covers this.

mecjos's avatar

@jlrdw it's public html... there is no problem on that side.. index.php is reachable in public_html..

jlrdw's avatar

@mecjos Sounds like folder structure is correct, but look at @snapey answer here:

https://laracasts.com/discuss/channels/servers/deploy-on-shared-server

Basically:

Main laravel here one folder above public_html  (main laravel out of web)
public_html  (what was in public now here)

I have used this setup and another I have used is http://novate.co.uk/deploy-laravel-5-on-shared-hosting-from-heart-internet/

Are you sure you have correct install (vendor folder) and correct php version? Check and make sure.

Is there more to the error you can show?

Also delete the two php files in bootstrap/cache folder. Sometimes that's an issue. Don't delete gitignore.

mecjos's avatar
mecjos
OP
Best Answer
Level 2

I removed all files and re uploaded.. probmlem seems to be fixed.. now I have anothe one )

Please or to participate in this conversation.