700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > 如果Laravel 报错 file_put_contents(): failed to open stream

如果Laravel 报错 file_put_contents(): failed to open stream

时间:2019-03-29 00:27:53

相关推荐

如果Laravel 报错 file_put_contents(): failed to open stream

问题解决方法

执行命令php artisan cache:clear并赋予/storage文件夹读写权限:chmod -R 777 storage

若在执行php artisan cache:clear时出现错误:Uncaught UnexpectedValueException: The stream or file "/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied in /vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:87,需要赋予/storage/log读写权限:chmod -R 777 storage/logs

此时再执行php artisan cache:clear,若继续出错:[ErrorException] file_put_contents(/bootstrap/cache/services.php): failed to open stream: Permission denied,需要赋予bootstrap/cache读写权限:chmod -R 777 bootstrap/cache

再执行php artisan cache:clear,若仍然出错:[PDOException] SQLSTATE[HY000] [1045] Access denied for user 'xxx'@'127.0.0.1' (using password: YES),则需要查看 laravel 的数据库配置是否正确。

来源:/zhangzhijian/p/10789524.html

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。