1

I have seen a few posts on this (and tried the recommended solutions) but they are regarding Laravel 4 - And I am on Laravel 5.

For example;

'Failed to open stream: Permission denied' error - Laravel

I get the Command "dump-autoload" is not defined error and the reason for that is explained here;

http://laravel.io/forum/12-08-2014-command-dump-autoload-is-not-defined

In the above post, composer dump-autoload was suggested. I tried it, and again this morning the same error is back;

ErrorException in Filesystem.php line
74:file_put_contents(/vagrant/source/laravel- excel/storage/
framework/sessions/8338f386fc3de7bdc8d1b6dc7ee6790f71516d98): failed
to open stream: Permission denied`

Any suggestions?

Community
  • 1
  • 1
mikelovelyuk
  • 4,042
  • 9
  • 49
  • 95
  • This is permissions issue on the filesystem. Ensure that the storage folder and all of its subfolders are fully accessible by the user you're using to execute composer. – Joe Apr 08 '15 at 09:09
  • Have you changed the folder `storage` permission to 644 or 755 yet? http://laravel.com/docs/5.0/installation#configuration – mininoz Apr 08 '15 at 09:09
  • This could be related to how you edit the files on the server. Which IDE do you use? Do you use some sort of "automatic upload of changed/created files" option? I'm asking because changing or creating a new file, then uploading it to the server "automatically" will usually set that file's permissions to the user with which you _connect_ to the server, and it could be different than the one the webserver operates under. – kalatabe Apr 08 '15 at 09:45
  • @KaloyanDoichinov I am using Vagant and Sublime Text 2 to edit my files.. Yes I suppose I am uploading to the server "automatically" in that case. – mikelovelyuk Apr 08 '15 at 10:14
  • Okay, then try to create a new file in your Sublime project, then go to the console on the server and do `ls -la /path/to/new/file.php` - this will show you which user the file belongs to and what its permissions are. Also, the path above has a space in it: `/vagrant/source/laravel- excel/storage/ framework/sessions/` - are you sure that's accurate? This space might be confusing to the script. – kalatabe Apr 08 '15 at 10:17
  • That space was just me using StackOverflow. Sorry. The new file I created has "vagrant" as the user and group. Just like all the others in same directory. The permissions are 644. All the others are 777 (because I've been doing that whenever I get that error) – mikelovelyuk Apr 08 '15 at 10:31
  • I haven't used Vagrant, but if all other dirs have the same user:group set, it's probably the same user that the webserver runs. 4 means reading only, change the permissions of app/storage to `664` **recursively** – kalatabe Apr 08 '15 at 10:35
  • Interestingly, `chmod -R 664 laravel-excel` does not clear the error but `chmod -R 777 laravel-excel` does... – mikelovelyuk Apr 08 '15 at 11:46

2 Answers2

1

Also, try the above comments and do a

composer self update

Matt Hiscock
  • 105
  • 1
  • 7
0

You Have to set the permission to Read & Write

In Mac We do this by using

**sudo chmod -R o+w storage**

Storage is the name of file U want to change permission And currently my terminal is in the same folder where my storage folder is present therefore I did not specify its address

Rohit Dalal
  • 856
  • 9
  • 12