mkdir(): Yii2 中的权限被拒绝 [英] mkdir(): Permission denied in Yii2

查看:65
本文介绍了mkdir(): Yii2 中的权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

安装 yii2 后,出现以下错误.

After installing yii2, I got the following error.

有人建议我应该给 IIS_IUSRS 完全权限,但仍然无济于事.

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

推荐答案

您不需要将权限设置为 777,这是一个安全问题,因为它提供了对世界.可能是你的 apache 用户没有目录的读/写权限.

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.

如果您使用 Ubuntu,请执行以下操作:

If you use Ubuntu do this :

确保所有文件都归 Apache 组和用户所有.在 Ubuntu 中,它是 www-data 组和用户

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

下一步启用www-data组的所有成员读写文件

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

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

php mkdir() 函数 现在应该可以正常工作而不会返回错误

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

这篇关于mkdir(): Yii2 中的权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆