简体   繁体   English

Laravel 5.1,无法打开流:权限被拒绝

[英]Laravel 5.1, failed to open stream: Permission denied

I am having a challenge uploading a file into app/storage . 我在将文件上传到app/storage时遇到了挑战。 Upon uploading the file I get this error: 上传文件后,我收到此错误:
file_put_contents(C:\\xampp\\htdocs\\ProjectName\\storage\\app\\folderName): failed to open stream: Permission denied . file_put_contents(C:\\xampp\\htdocs\\ProjectName\\storage\\app\\folderName): failed to open stream: Permission denied

I tried using chmod -R 777 storage/app , but still have the same problem. 我尝试使用chmod -R 777 storage/app ,但仍然有同样的问题。

Would really like know how to solve this problem. 真的很想知道如何解决这个问题。

Make sure apache has write access to PHP's temp folder ( C:\\xampp\\tmp\\ usually) as well as all of storage (not just storage/app). 确保apache具有对PHP临时文件夹(通常为C:\\xampp\\tmp\\ )以及所有storage (不仅仅是存储/应用程序)的写访问权限。 Also, be sure the uploads folder actually exists ( C:\\xampp\\htdocs\\ProjectName\\storage\\app\\folderName ). 另外,请确保uploads文件夹实际存在( C:\\xampp\\htdocs\\ProjectName\\storage\\app\\folderName )。

PHP first uploads files to the tmp folder, and then moves them into storage. PHP首先将文件上传到tmp文件夹,然后将它们移动到存储中。

Here's how to change permissions in Windows 7 . 以下是如何在Windows 7中更改权限

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM