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

Flex's avatar
Level 4

how to manage laravel project public folder containts in shared hosting

working with Laravel 9 and hosted project with shared hosting plan in hostgrator. I have put all my laravel public folder contents in the live server public_html folder as well. now it is working but one of following image access is not working properly and it is encounting following error message Swift_IoException Unable to open file for reading [/home3/abc/abc/public/images/logo.png]

in my blade file containt following image path segment

<img src="{{ $message->embed(public_path('images/logo.png')) }}" alt="" style="width: 300px; max-width: 600px; height: auto; margin: auto; display: block;">

I think above error occurred because of change of public_html path. how could I fix laravel public folder path as public_html in live shared hosting?

0 likes
1 reply
jlrdw's avatar

You are pointing to public as document root? Main laravel files should be out of (one folder above) public_html.

FYI, shared hosting has be covered many times. Try punching this into Google:

site:laracasts.com set up laravel on shared hosting

Also I believe that host has how to articles.

Also another guide: http://novate.co.uk/deploy-laravel-5-on-shared-hosting-from-heart-internet/

One past post: https://laracasts.com/discuss/channels/laravel/how-to-deploy-laravel-9-on-shared-hosting

But many more.

Please or to participate in this conversation.