Problem:
--ErrorException: touch(): Unable to create file
Getting File permissions error under the Storage folder
Solution:
I applied for special permissions on the “Storage” folder as Laravel Framework requires some folders to be Read-writable for the apache user. So, I used ACL, which provides a flexible permission mechanism for the file structure.
# Maintain the standard permissions structure for the project’s directories and files:
-
Change mode
$ sudo find /path/to/project/ -type d -exec chmod 755 {} \;
$ sudo find //path/to/project/ -type f -exec chmod 644 {} \;
The above commands will find the directories and files individually under your project and assign permissions 755 to all directories and 644 to all files. -
Ownership
$ sudo chown -R $USER:$USER /path/to/project/
The above command will change the user owner to your default login user.
Now go inside the laravel project and set the ACL permissions on the storage folder. -
Implement ACL
$ cd /path/to/project/
$ sudo setfacl -Rdm u:www-data:rwx storage
With the above command, an Apache user can read or write into the files and directories under the storage folder. Now please recheck. I hope it helps you.
jQuery presents a tree-like structure of all the elements on a webpage simplifying the syntax and further manipulating such elements. The jQuery Certification exam by StudySection will secure your fundamental knowledge and a basic understanding of jQuery as an asset to improve your skills.