Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yii2 - The directory is not writable by the Web process | frontend/web/assets

I have searched this issue on internet but none of them helped me. Also this one doesn`t:

chgrp apache /path/to/mydir
chmod g+w /path/to/mydir

My server is centos 7. Can you help me?

like image 762
Shaig Khaligli Avatar asked Dec 27 '15 16:12

Shaig Khaligli


3 Answers

I have the problem too (in CentOS7). I tried to change the owner and group, but it didn't work. Finally, I closed the selinux, and it work.

setenforce 0

If you want to close it forever, you can change the /etc/selinux/config file:

SELINUX=disabled
like image 22
lizs Avatar answered Sep 25 '22 11:09

lizs


Try with following commands:

  1. This will give you the name of apache user.
    ps -ef | grep apache | grep -v grep

    In most of the cases the user will be www-data.

  2. Run these command after going into the /frontend/web folder:
    sudo chgrp www-data ./assets
    and
    sudo chmod g+w ./assets/

Your problem will be solved.

like image 143
Sam Avatar answered Sep 24 '22 11:09

Sam


i have same issue in ubuto instance i did like that and issue solve

sudo chmod 777 /home/nicjccom/public_html/asset

and also did this

sudo chgrp root /home/nicjccom/public_html/asset
like image 29
Adiii Avatar answered Sep 25 '22 11:09

Adiii