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!

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

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题