duan4739 2018-12-05 04:44
浏览 71
已采纳

在服务器上传后,Laravel Voyager图像被破坏

Laravel Version: 5.5 Voyager Version: 1.0 PHP Version: 7

I have uploaded my laravel project in cPanel. Previous images are shown successfully but the newly added images are not showing.

enter image description here

Here last 2 images are already in the project before uploading in cPanel. After uploading the project successfully in cPanel I have try to upload an image but it is not shown which is first one.

Anybody help ?

i tryed with change in config/filesystem.php

Change the path from storage_path() to public_path().

'public' => [ 'driver' => 'local', 'root' => public_path('app/public'), 'url' => env('APP_URL').'/storage', 'visibility' => 'public', ],

but it not worked. please help me!

broken image url- http://example.com/storage/products/December2018/QIDyzoFg1aAf6NUGMJtZ.jpg

  • 写回答

1条回答 默认 最新

  • dongshu9458 2018-12-09 10:54
    关注

    i found the solution ! the promblem was in the symlink(storage symbolic link). in the localhost we can easily create the symlink from voyager adminpannel or in terminal php artisan storage:link in that case in shared hosting we cannot do that .see below what i do.

    1.log in to the cpannel

    2.go the project folder then go public->storage folder then rename it to storage old or somthing.

    3.come back to the cpannel main menu and select the cron job

    4.in common settings --> select *once per 5 minutes

    5.in the command field add this ln -s /home/cpanel_username/project_name/storage/app/public /home/cpanel_sername/project_name/public/storage

    (my site was in subdomain) example-ln -s /home/your_cpannel_user name/public_html/subdomain_foldername/storage/app/public /home/cpanel_username/public_html/subdomain_foldername/public/storage

    syntax-->ln -s target_path link_path

    6.type your email in the cron email and update email(when the job was done email notification wiil come to your inbox check the spam folder)

    6.create new cronjob

    7.wait few minutes you almost done.! after the execution delete the cronjob

    8.log and check upload path working correctly!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 求恶意流量检测系统搭建教程( C++ python C)
  • ¥15 mmseqs内存报错
  • ¥15 vika文档如何与obsidian同步
  • ¥15 华为手机相册里面的照片能够替换成自己想要的照片吗?
  • ¥15 陆空双模式无人机飞控设置
  • ¥15 sentaurus lithography
  • ¥100 求抖音ck号 或者提ck教程
  • ¥15 关于#linux#的问题:子进程1等待子进程A、B退出后退出(语言-c语言)
  • ¥20 web页面如何打开Outlook 365的全球离线通讯簿功能
  • ¥15 io.jsonwebtoken.security.Keys