mkdir(): Permission denied in Yii2

时光总嘲笑我的痴心妄想 提交于 2019-12-25 04:37:19

问题


After installing yii2, I got the following error.

Some suggests that I should give full permissions to IIS_IUSRS but still to no avail.


回答1:


You shouldn't need to set the permissions to 777, that is a security problem as it gives read and write access to the world. It may be that your apache user does not have read/write permissions on the directory.

If you use Ubuntu do this :

Make sure all files are owned by the Apache group and user. In Ubuntu it is the www-data group and user

chown -R www-data:www-data /path/to/webserver/www

Next enabled all members of the www-data group to read and write files

chmod -R g+rw /path/to/webserver/www

The php mkdir() function should now work without returning errors



来源:https://stackoverflow.com/questions/41539915/mkdir-permission-denied-in-yii2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!