zoukankan      html  css  js  c++  java
  • 如果Laravel 报错 file_put_contents(): failed to open stream

    问题解决方法

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

    2. 若在执行 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

    3. 此时再执行 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

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

  • 相关阅读:
    10.用户管理
    9.更新系统时间
    8.标准输入输出重定向
    7.文件压缩与find命令
    6.Linux文件的详细属性
    5.Linux基础命令
    4.Linux目录结构
    3.磁盘光驱挂载
    2.xshell连接
    javascript中的location的用法
  • 原文地址:https://www.cnblogs.com/zhangzhijian/p/10789524.html
Copyright © 2011-2022 走看看