During installation, yii2 got this error. 
Many people advise finding out the username of apache and giving it privileges to the ./assets directory by executing this command,
ps -ef | grep apache | grep -v grep
The solution turned out to be very simple, it was enough to click on the 'Details' button in the SELinux error browser.
I recently encountered this problem on a CentOS server.
The solution to the problem was written in the comment to the question, but I want to issue it in the form of an answer:
chcon -R -t httpd_sys_rw_content_t /path/to/folder As @ k-lobastov said: " Blocks SELinux ", even if the rights (CHMOD) cost 777.
Source: https://ru.stackoverflow.com/questions/538943/
All Articles
chcon -R -t httpd_sys_rw_content_t /ПУТЬ/ИМЯ_ПАПКИ- Kirill