PHP工匠存储:链接删除存储的文件(Digitalocean)

发布于 2025-01-31 07:00:32 字数 315 浏览 2 评论 0原文

情况:我在Digitalocean上上传了一个Laravel项目,并在YAML文件中的下一个命令中上传了

run_command: |- 
php artisan migrate --force
php artisan storage:link
heroku-php-apache2 public/

问题:每个部署,这些命令正在运行并删除存储文件。如何在不删除上传文件的情况下部署?

其他信息: - 1-表记录不仅删除上传的文件 2-图像路径:base_url/storage/images/products/imagename.png

The case: I Upload a Laravel project on DigitalOcean with the next commands In Yaml file

run_command: |- 
php artisan migrate --force
php artisan storage:link
heroku-php-apache2 public/

The issue: Every deployment, these commands are being run and the storage files are deleted. How can I deploy without deleting uploaded files?

additional info:-
1- Table records are not deleted Just the uploaded files
2- imagePath: base_url/storage/images/products/imageName.png

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

吲‖鸣 2025-02-07 07:00:32

解决方案:这不是问题。问题是每个部署,Digitalocean每次都在不同的服务器(容器)上部署,因此它就像一个新设备。但是桌子没有清理,只是存储的东西

The Solution: It's not an issue. the problem is every deployment, DigitalOcean deploys every time on a different server (Container) so It's like a new device. but tables are not cleared just storage stuff

阪姬 2025-02-07 07:00:32

我使用此命令来解决此问题,

cd public/ && ln -s ../storage/app/public storage && cd ..

请确保您的存储文件夹不是.gitignore
到.gitignore删除公共/存储

I fix this problem with this command

cd public/ && ln -s ../storage/app/public storage && cd ..

make sure your storage folder is not .gitignore
got to .gitignore remove public/storage

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文