Answer the question
In order to leave comments, you need to log in
How to make files created by laravel have the right to be executed?
I have a vds, there is a laravel project there, when working with it, it happens that it seems to create files and itself cannot access them. Error example:
[email protected]:/var/www/[корневая папка сайта]/blog$ php artisan make:migrate
UnexpectedValueException : The stream or file "/var/www/[корневая папка сайта]/blog/storage/logs/laravel-2019-09-09.log" could not be opened: failed to open stream: Permission denied
Answer the question
In order to leave comments, you need to log in
1) install sudo
2) create a file /etc/sudoers.d/your_user_name
3) with the following content:
4) now you can execute commands on behalf of a user who has write permissions:
https://wiki.gentoo.org/wiki/Sudo/ru
5) to simplify, you can add to ~/.bashrc
alias phpsudo="sudo -u user_name_of_php_run_php"
now you can use the phpsudo command instead of sudo -u user_name_of_php_run_php"
5 point won't work until you relog to the server or run source ~/.bashrc
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question