我需要在 .ebextensions/setup.config 中设置
php artisan storage:link
的建议。目前,执行命令后,我的存储文件夹链接在路径“/var/app/ondeck/storage/app/public”下,而不是“/var/www/html/storage/app/public”下。以下是我的设置配置。
06-link_storage:
command: "php artisan storage:link"
cwd: "/var/app/ondeck"
这是我的一个实例中链接的路径的屏幕截图。
我还尝试将路径更改为/var/www/html。然而路径链接也无效。
06-link_storage:
command: "php artisan storage:link"
cwd: "/var/www/html"
任何帮助或建议对我来说都意义重大。谢谢。
对我有用的唯一选择是使用 postdeploy 钩子手动创建符号链接:
<project root>/
├── .platform/
│ └── hooks/
│ └── postdeploy/
│ └── 01_symlink.sh
01_symlink.sh
在 DocumentRoot
具有 /public
:
#!/bin/bash
ln -sf ../storage/app/public storage