php - ErrorException flock() 期望参数 1 是资源
问题描述
我有一个 laravel Web 应用程序,它有一些用户并且运行良好。
但有时我会在下面显示这个错误:
ErrorException App\Http\Controllers\ApiController@errorLog flock() expects parameter 1 to be resource, bool given
我拥有所有权限的文件夹。
像stackoverflow中的其他线程一样:
chmod 775 storage/framework/cache
chmod 775 storage/framework/cache/data
sudo chgrp www-data storage/framework/cache
sudo chgrp www-data storage/framework/cache/data
我认为会有更多的人同时访问它并且文件被锁定。但是在发生此错误的用户中,他们只是在使用它。
我无法理解这种情况。
解决方案
推荐阅读
- laravel - 如何从分页记录中获取第 2 页
- sql-server - 将日期时间格式从 DD-MON-YY HH:mm:ss.mmmmmmmmm AM/PM 转换为 YY-MM-DD HH:mm:ss.mmmmmmm(24 小时格式)
- cmake - 为什么 find_package() 不查看 ${
_DIR}/lib/cmake/ - ? - python - 在 Python 中使用后台进程更新字典
- javascript - csv.html:24 Uncaught ReferenceError: [function] is not defined at HTMLButtonElement.onclick
- css - 如何在 CSS 中对齐按钮中的文本
- java - JBoss 启动期间 ExecutorService 抛出 NullPointerException
- python - 检查元组内的数组在Python中是否为空
- c# - 如何使用 xUnit 测试包含 await 的 async void DelegateCommand 方法?
- regex - 如何在ansible中从文件中读取文本块