Laravel 5工作了一段時間後墜毀。這裏的錯誤:Laravel 5 - 寫信給供應商目錄
file_put_contents(/Library/WebServer/Documents/project/vendor/services.json): failed to open stream: Permission denied
in Filesystem.php line 74
我想知道爲什麼它試圖寫入供應商目錄?
Laravel 5工作了一段時間後墜毀。這裏的錯誤:Laravel 5 - 寫信給供應商目錄
file_put_contents(/Library/WebServer/Documents/project/vendor/services.json): failed to open stream: Permission denied
in Filesystem.php line 74
我想知道爲什麼它試圖寫入供應商目錄?
(見下更新!)
用於緩存存儲的一些文件,其中移動到不同的位置Laravel v5.0.15。
受影響的文件:
引述開發者之一:
It makes more sense in vendor. This makes it more clear that the file is very specifically tied to the installed dependencies.
更多信息和關於陳的討論ges,請參閱this commmit。
更新:維護人員在討論後改變了這種行爲。
自v 5.1起,所有三個文件將被寫入bootstrap/cache
。如果你使用v。5.0,請閱讀:
供應商目錄將不會被寫入,除非它實際上是可寫的。
此外,方法useStoragePathForOptimizations(bool)
已添加到Illuminate \ Foundation \ App並可從bootstrap/app.php中調用。這將設置屬性$useStoragePathForOptimizations
並確定是否應將存儲目錄用於優化。
請參見下面的兩次提交了更多的信息:
這應該被接受的答案。 – 2015-03-24 02:20:05
我該如何解決這個問題? – thegeekajay 2015-06-03 06:44:05
@ ajay23romu,你有兩個選擇:1)升級到Laravel 5.1,它使用'bootstrap/cache'目錄來存儲緩存文件。確保這個目錄是可寫的。或2)編輯'bootstrap/app.php'並添加以下行:'$ app-> useStoragePathForOptimizations(true);'然後確保'storage/framework'目錄是可寫的。但是,建議升級到「長期支持」版本的Laravel 5.1。 – nicoqh 2015-06-27 22:50:14
試試這個工匠命令
php artisan cache:clear
太棒了!非常感謝:) – Matz 2015-03-23 18:00:27
哇,我不知道發生了什麼,但它的工作!儘管當我遇到這個問題時我正在設置Form Facade。 – 2015-03-29 16:10:51
這對我有用。 – 2015-07-25 00:22:45
'PHP工匠緩存:clear' – macki 2015-07-29 11:42:06