CHLOE HARLOW
CHLOE HARLOW

Reputation: 1

laravel 10 php artisan storage:link problem in my live app on plesk / unix enviroment images will not show via symlink

i have installed laravel 10 as of july 2023, and i have installed breeze and then created a CRUD and Image Upload app

i have followed along with the guide Laravel 10 CRUD and Image Upload Tutorial with Laravel Breeze and Repo Example

i have now tried doing this 3 times and eveything works ok, apart from the display of the images from the uploaded post(s), i am guessing its something to do with the command

php artisan storage:link

the images are being uploaded, i can see them in the directory

public storage images posts featured-images NE3chyoFJVASXGGzw6vaxiSfxXNi9KCN2Z0Z3hef.jpg

and my image link generated in laravel isis

https://plwd.com/shopshare/storage/images/posts/featured-images/NE3chyoFJVASXGGzw6vaxiSfxXNi9KCN2Z0Z3hef.jpg

a Symbolic Link should have been created from the public/storage folder to the storage/app/public folder when i ran the command - php artisan storage:link i have unchecked the box in plesk on my domain to Restrict the ability to follow symbolic links, so this should not be the issue

what am i missing here, the website is hosted on plesk in unix enviroment

i have tired starting over again from the start, and everytime, i end up with the same problem as images not diplaying

Upvotes: 0

Views: 682

Answers (1)

Mahri Ilmedova
Mahri Ilmedova

Reputation: 340

When you run command for linking storage in Laravel it creates symbolic link "storage" inside the "public" folder of your project. If you check the public folder there you should be able to see a symbolic link for "storage" folder. The problem here might be that you already had linked storage while you were working in your localhost. It means that the symbolic link has been created in your local machine and that's why it is not working on your production server. Try first removing the symlink "storage" from "public" folder of your project:

rm public/storage

then rerun command for linking storage again but through ssh connection to your server as the symbolic link should be generated in server and not your localhost:

php artisan storage:link

Hope this helps! :)

Upvotes: 0

Related Questions