我在设置 Laravel 4 时遇到问题。打开索引页时遇到此错误:
file_put_contents(/Users/laravel/app/storage/meta/services.json) [function.file-put-contents]:
failed to open stream: Permission denied.
我在这里缺少什么?
最佳答案
我认为 chmod -777 是一个不好的做法。
为了解决 Laravel 上的权限问题,我已经这样做了(使用 root 用户):
cd 应用程序/
chown -R www-data:www-数据存储
CD存储/
查找 . -type d -exec chmod 775 {}\; && 寻找 。 -type f -exec chmod 664 {}\;
并且始终位于应用程序/存储目录中:
chown your_user:user_group .gitignore缓存/.gitignore日志/.gitignore元/.gitignore session /.gitignore View /.gitignore
现在,退出root用户,就可以了。
编辑:这是 Laravel4 的。由于结构不同,这不适用于 Laravel5。
关于拉拉维尔 4 : Failed to open stream: Permission denied,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17020513/