Posts

Showing posts from December, 2017

Securely setting Files and Folder permissions on Laravel 5

Image
Securely setting Files and Folder permissions on Laravel 5 Introduction: Handling file and folder permission in Laravel 5 and above. Why was this tutorial made? I had a similar issue while running Laravel Application and Cron Jobs on the same server. So what is the problem here? The issue here was while creating a log file. When the log files are created by the Web Application the file permission would look like. -rw-r--r-- 1 www-data www-data 1646 May 11 2017 laravel.log //Permissions are set to Apache User Similarly, when the log files are created by the Cron Jobs then the file would have its owner and group owner as your Apache User. -rw-r--r-- 1 ubuntu ubuntu 1646 May 11 2017 laravel.log //Permissions are set to User So, if the log file was created by Web Application same file can't be used bt Apache User and vice versa Error would look something like this The stream or file "/var/www/html/project-folder/storage/logs/lara...