【发布时间】:2017-10-20 13:26:26
【问题描述】:
我正在尝试将测试 Laravel 应用程序推送到 Heroku,但每当我尝试这样做时,我都会收到错误并且部署停止。这是我进行部署时显示的内容:
remote: Generating optimized autoload files
remote: > Illuminate\Foundation\ComposerScripts::postInstall
remote: > php artisan optimize
remote:
remote:
remote: [InvalidArgumentException]
remote: Please provide a valid cache path.
remote:
remote:
remote: Script php artisan optimize handling the post-install-cmd event returned with error code 1
remote: ! Push rejected, failed to compile PHP app.
remote:
remote: ! Push failed
remote: Verifying deploy...
这里有什么问题? storage/framework 文件夹包含所有需要的文件夹,它们包含在存储库中。那么这里有什么问题呢?
【问题讨论】:
-
尝试检查您的文件夹的权限。大多数文件夹应该是普通的“755”和文件,“644”Laravel 需要一些文件夹对于 Web 服务器用户是可写的。您可以在基于 *nix 的操作系统上使用此命令。
sudo chgrp -R www-data storage bootstrap/cachesudo chmod -R ug+rwx storage bootstrap/cache -
我会检查一下我认为在这种情况下文件夹是 777 - 我会试一试
-
不行 - 仍然给出同样的错误。
-
请三重检查并确认创建了以下文件夹:
storage/framework,并在框架文件夹中创建了以下 3 个:sessions、views、cache -
并尝试以下工匠命令:
php artisan cache:clear,php artisan config:clearphp artisan view:clear
标签: php git laravel heroku laravel-5