[英]Operation not permitted with sudo chown on mac
我收到此错误,我尝试按照许多说明进行操作,但没有成功。 请帮助我,谢谢! 我已经运行php artisan migrate
然后我得到了这个:
UnexpectedValueException
The stream or file "/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied
我尝试使用sudo
但我得到"Operation not permitted"
$ sudo chown -R www:www storage
Password:
chown: storage/app/public/.gitignore: Operation not permitted
chown: storage/app/public: Operation not permitted
chown: storage/app/.gitignore: Operation not permitted
chown: storage/app: Operation not permitted
chown: storage/oauth-private.key: Operation not permitted
chown: storage/logs/laravel.log: Operation not permitted
chown: storage/logs/.gitignore: Operation not permitted
chown: storage/logs: Operation not permitted
chown: storage/framework/sessions/.gitignore: Operation not permitted
chown: storage/framework/sessions: Operation not permitted
chown: storage/framework/cache/data/cc/c4/ccc4da08b14ef486fe32b15c805b5e95c7f3122b: Operation not permitted
chown: storage/framework/cache/data/cc/c4: Operation not permitted
chown: storage/framework/cache/data/cc: Operation not permitted
chown: storage/framework/cache/data/38/69/386948609bc3c4027c0048b9ef1c7e61d23cf80a: Operation not permitted
chown: storage/framework/cache/data/38/69: Operation not permitted
chown: storage/framework/cache/data/38: Operation not permitted
chown: storage/framework/cache/data/.gitignore: Operation not permitted
chown: storage/framework/cache/data: Operation not permitted
chown: storage/framework/cache/.gitignore: Operation not permitted
chown: storage/framework/cache: Operation not permitted
chown: storage/framework/views/a49dd52a70c9462f11ab6afe053e3413ed2600cf.php: Operation not permitted
chown: storage/framework/views/ff9e533ffd309c883ff47b05a9b2849d3b9947cc.php: Operation not permitted
chown: storage/framework/views/.gitignore: Operation not permitted
chown: storage/framework/views: Operation not permitted
chown: storage/framework/testing/.gitignore: Operation not permitted
chown: storage/framework/testing: Operation not permitted
chown: storage/framework/.gitignore: Operation not permitted
chown: storage/framework: Operation not permitted
chown: storage/oauth-public.key: Operation not permitted
chown: storage: Operation not permitted
您应该更改目录所有权,以便您的当前用户作为所有者和网络服务器用户(www-data,apache,...)作为组。
chown -R $user:www-data [推荐]
将当前用户设置为所有者,将网络服务器用户设置为组:
$ sudo chown -R $USER:www-data storage
$ sudo chown -R $USER:www-data
bootstrap/cache
设置目录权限为 775
$ chmod -R 775 storage
$ chmod -R 775 bootstrap/cache
chown -R 777 [不推荐]
您可以将两个目录设置为 777。
$ chmod -R 777 storage
$ chmod -R 777 bootstrap/cache
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.