-1

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.

enter image description here

enter image description here

Jashan PJ
  • 4,177
  • 4
  • 27
  • 41
  • 1
    Check your browser console for errors, view source and see what URLs it's outputting, and debug accordingly. Without any code or an example of the issue, we're not left with much to suggest. – ceejayoz Jan 25 '19 at 16:40
  • 1
    I guess this is related to the permissions policies of your EC2 resources. Trying access in the file through the EC2 panel to check permissions. I ran into this a couple of weeks ago. – Kenny Horna Jan 25 '19 at 16:42
  • In your screenshot, it's outputting the IP address twice. You'll want to figure out why. Perhaps you forgot the `http://` in your `APP_URL` setting. – ceejayoz Jan 25 '19 at 16:50
  • Yes, added the http, now storage link is okey. still 404. Is that any permission issue? – Jashan PJ Jan 25 '19 at 16:55
  • Does `public/storage/users/default.png` exist in your filesystem? – ceejayoz Jan 25 '19 at 17:53
  • I think no, pls see the terminal screen above. – Jashan PJ Jan 26 '19 at 02:16

3 Answers3

0
  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.

Jihun
  • 93
  • 2
  • 6
0

for local host, try

Updated .env file:

APP_URL=http://localhost:8000

then
php artisan config:cache php artisan cache:clear

Abhi
  • 119
  • 1
  • 2
-1

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)

Jashan PJ
  • 4,177
  • 4
  • 27
  • 41