samedi 28 septembre 2019

Whenever I create folder with Laravel Command I get "Permission denied" on edit or delete

I have controller that creates images and stores them in a new folder. When I go to the admin panel and create a new image a folder is automatically created with all the right permissions.

The problem comes when I do the absolutely same operation, but with a Laravel command, which I registered in the Kernel.

The command uses the same controller and the same functions but the permissions are all wrong, it creates the image and the directory, but after that it is unusable. I can't edit or delete it.

The only way to fix it is to run chown -R www-data:www-data /var/www/ in the server terminal.

I already tried to make the folder with mkdir($filePublicPath, 0755, true) but the issue remains. How can I fix this? How to make a directory with the laravel command and have good permissions?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2myQGs8
via IFTTT

Aucun commentaire:

Enregistrer un commentaire