@evooms123 You need to modify the permissions of your public folder and its children.
Additionally have you run php artisan storage:link ?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello everyone,
I put my website online, and the images are not showing. So I went to the site and went to the developer console.
The following error is displayed:
Failed to load resource: the server responded with a status of 403 ()
However, when I tried my site in localhost, everything was showing normally. When I copy/past the img src in my code (using the developer tool) into the my internet URL, I've an
forbidden You don't have permission to access this resource.
So do I need to edit something somewhere to display the images? Do I have to modify any rights?
NB: I'm using OVH.
There is the code I use to store the picture and the one I use to display the picture :
protected function saveFiles($idArticle, $file)
{
$article = Article::where('id_article',$idArticle)->firstOrFail();
$path = 'public/documents/articles/' . $idArticle . '/' . $article->titre;
$fileName = $idArticle.'-'.$article->titre.'.'.$file->getClientOriginalExtension();
$file->storeAs($path, $fileName);
}
In another function I'm doing that :
$data = array();
$path = 'public/documents/articles/';
$files = Storage::files($path.$editer_article->id_article . '/' . $editer_article->titre);
$data[$editer_article->id_article] = url(Storage::url($files[0]));
return view('test', ['data' => $data]);
This is inside my controller. Inside my view I'm doing :
<img src="{{ $data[$article_carousel->id_article] }}" class="d-block w-100" alt="{{$article_carousel->titre}}"/>
As I said, this is working in local, but not online.
Cordially,
I've successfully resolved the problem ! I deleted the link inside the public folder and did this : ln -s ../storage/app/public storage
Please or to participate in this conversation.