简体   繁体   中英

Laravel Voyager Avatar not showing in AWS EC2

AWS EC2 is not showing the avatar in Laravel Voyager. Typically when this kind of error pop ups in local server we used to change the APP_URL in .env to fix the problem.

But I have no idea now in the case of AWS EC2. I think it's the problem with reading/writing permission, when I inspect the console it shows a 404 error for the image path. When I check the path the user/default.png (folder and fie) doesn't exist in the storage folder of server. I tried manually creating user and file using FileZilla FTP, and tried calling it. Still it returns a 404.

在此处输入图片说明

在此处输入图片说明

  1. delete storage short-link in public directory if it exists.
  2. remake a new link with artisan command (php artisan storage:link)
  3. confirm that the APP_URL={your domain}
  4. php artisan config:cache
  5. re-run the server

It always worked for me.

for local host, try

Updated .env file:

APP_URL= http://localhost:8000

then
php artisan config:cache php artisan cache:clear

Change the permission of the root folder (in this case /var/www/html) to 775

Then run the commands php artisan vendor:publish

Found the answer with the help of Git Hub Collaborator support. ( https://github.com/the-control-group/voyager/issues/3917 )

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