无法访问Heroku上的作曲家供应商文件夹 [英] No access to composer vendor folder on Heroku
问题描述
我在Heroku上托管一个PHP应用程序,它使用composer安装Bootstrap。当我将应用程序部署到Heroku时,所有的作曲家依赖项都按照预期安装在vendor子目录中。
I'm hosting a PHP application on Heroku which installs Bootstrap using composer. When I deploy my application to Heroku all composer dependencies are installed in the "vendor" subdirectory as expected.
我现在试图在HTML视图中包含Bootstrap, code>< link href =https:// [Heroku app URL] /vendor/twbs/bootstrap/dist/css/bootstrap.min.css =stylesheet> 但由于我没有权限访问供应商目录,导致出现403 Forbidden错误。
I'm now trying to include Bootstrap in my HTML views with <link href="https://[Heroku app URL]/vendor/twbs/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
but that results in a "403 Forbidden" error because I have no permission to access the vendor directory.
我不知道如何才能访问该目录在我的HTML页面中包含所需的JS和CSS文件。
I have no idea how I can gain access to that directory to include the needed JS and CSS files in my HTML pages.
推荐答案
Heroku有意限制访问作曲家供应商目录,成为最佳实践。为了访问选定的资源,我在公共目录中创建了符号链接(符号链接)到所需的文件。
Heroku restricts access to the composer vendor directory on purpose, seems to be "best practice". To gain access to selected resources, I created symbolic links (symlinks) in a public directory to the needed files.
这篇关于无法访问Heroku上的作曲家供应商文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!