如果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 的数据库配置是否正确。

原文地址:https://www.cnblogs.com/zhangzhijian/p/10789524.html

时间: 2024-07-31 21:57:13

如果Laravel 报错 file_put_contents(): failed to open stream的相关文章

git push报错error: failed to push some refs to '[email protected]:

$ git push -u origin master To [email protected]:xxx/xxx.git ! [rejected] master -> master (fetch first) error: failed to push some refs to '[email protected]:xxx/xxx.git' hint: Updates were rejected because the remote contains work that you do hint:

在CentOS中安装32位或64位MySql报错error: Failed dependencies解决办法

在CentOS中安装MySql报错error: Failed dependencies解决办法 安装64位MySql报错内容如下:error: Failed dependencies:        libaio.so.1()(64bit) is needed by MySQL-server-5.6.19-1.el6.x86_64    libaio.so.1(LIBAIO_0.1)(64bit) is needed by MySQL-server-5.6.19-1.el6.x86_64    

VM虚拟机启动报错Reason Failed to lock the file怎么办

VMware启动报错Reason: Failed to lock the file的解决方法 症状:  启动VMware虚拟机的时候出现了Cannot open the disk '*.vmdk' or one of the snapshot disks it depends on.Reason: Failed to lock the file.的错误. 解决办法一: 1.在VMware该虚拟机路径下的所有.lck文件和文件夹下删除或迁移至其它目录,一般就可以解决了. 2.如果再次启动VMwar

svn报错cleanup failed–previous operation has not finished; run cleanup if it was interrupted的解决办法

今天在svn提交的时候它卡顿了一下,我以为已经提交完了,就按了一下,结果就再也恢复不了,也继续不了了... 报错 cleanup failed–previous operation has not finished; run cleanup if it was interrupted 试过执行cleanup,结果也是失败,要更新先要cleanup,但是cleanup的失败信息又叫我cleanup……这是一个死循环! 感觉这是一个设计上的缺陷:使用工作队列来保存数据,后一个操作依赖于前一个操作的结

Android Studio报错:Failed to complete Gradle execution.

解决Android Studio报错:Failed to complete Gradle execution. 运行Android Studio的时候,出现以下错误: 原因:用于启动虚拟机的内存不够,android studio的默认最大内存是10g,所以对于4g.8g内存的电脑来说,内存不够用,不过为什么有时不会出问题有时会,可能是google优化不好吧,但这又有个问题,把参数改为1g.2g都不行,一定要更小才行,只能说明Android studio确实有bug. 解决方法 1: 解决方法 2

解决Eclipse启动报错【Failed to create the Java Virtual Machine】

电脑:2G内存,WIN7 32位. 启动adt-bundle-windows-x86-20140702\eclipse\eclipse.exe时,报错[Failed to create the Java Virtual Machine].点确定后,Eclipse自动关闭 解决方法如下: 修改Eclipse目录下的配置文件[eclipse.iniadt-bundle-windows-x86-20140702\eclipse\eclipse.ini] 将下面两个值改为原来的0.5倍,然后保存,重新启

opatch apply 报错 OPatch failed with error code 73

1.执行opatch apply 报错 OPatch failed with error code 73 [[email protected]_11g 14275605]$ /opt/oracle/product/db_1/OPatch/opatch apply ./ Oracle Interim Patch Installer version 11.2.0.3.0 Copyright (c) 2012, Oracle Corporation.  All rights reserved. Ora

appium在android 7.0真机上运行报错command failed shell:............ps:'uiautomator"的解决方式

appium版本:1_4_16 在CSDN中找到相关解决的方案,根据此解决方案顺利的解决了让人惆怅的问题,再次记录. 1.找到appium安装目录下的adb.js文件,目录为:Appium\node_modules\appium\node_modules\appium-adb\lib 2.打开adb.js,可使用notepad++编辑器等打开文件(说明:在修改代码的时候先注释掉以前的代码,并且添加自己容易识别的标记,以防出错后还有回旋的余地,或者将代码备份也可行),找到如下代码: ADB.pro

(转)启动网卡报错(Failed to start LSB: Bring up/down networking )解决办法总结

启动网卡报错(Failed to start LSB: Bring up/down networking )解决办法总结 原文:http://blog.51cto.com/11863547/1905929 http://blog.csdn.net/debimeng/article/details/74296152?utm_source=itdadao&utm_medium=referral Failed to start LSB: Bring up/down networking 遇到这个错误好