Laravel 5.1, failed to open stream: Permission denied

时间:2015-07-28 15:42:13

标签: php laravel

I am having a challenge uploading a file into 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.

I tried using chmod -R 777 storage/app, but still have the same problem.

Would really like know how to solve this problem.

1 个答案:

答案 0 :(得分:2)

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). Also, be sure the uploads folder actually exists (C:\xampp\htdocs\ProjectName\storage\app\folderName).

PHP first uploads files to the tmp folder, and then moves them into storage.

Here's how to change permissions in Windows 7.