我目前在Laravel项目中创建符号链接时遇到一些问题。我目前在Windows 10 OS
上,并且正在使用GitBash
。
我需要创建从storage/app/products_content
到public/products_content
的符号链接
为此,我使用以下命令:
ln -s storage/app/products_content public/products_content
问题是,我遇到以下错误:
ln:无法创建符号链接“ public / products_content”:否这样 文件或目录
但是,当我尝试创建这样的符号链接时:
ln -s storage/app/products_content products_content
它创建时没有错误,但是文件夹位于我的root
目录中,而不是/public
中。
是什么导致此错误,可能是权限问题?我以管理员身份运行GitBash。任何帮助表示赞赏。如果我需要提供任何其他代码,请告诉我。
答案 0 :(得分:2)
只需运行:php artisan storage:link
,然后将路径修改为:storage/products_content
答案 1 :(得分:2)
您可以在文件系统配置文件中配置其他符号链接。当您运行storage:link命令时,将创建每个配置的链接:
var allAuth = [1, 2, 3, 4, 5, 6, 7, 8];
let thomasauth = [2, 3, 4, 5, 6, 7, 8];
let result = allAuth.filter(val => thomasauth.indexOf(val) !== -1);
console.log(result);
答案 2 :(得分:1)
尝试进入public
文件夹,然后执行以下操作:
ln -s ../storage/app/products_content products_content
如果不起作用,请打开命令提示符(不是PowerShell)
然后“浏览”到public
文件夹,然后执行:
mklink /D products_content ..\storage\app\products_content
mklink
与ln
相同,除了目标和链接已切换。