热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Laravel、Lumen错误集锦

持续更新。。。这里收集了遇见的laravel或则lumen错误和解决方法。controller或者model不存在1.notfoundClass\App\UserControlle

持续更新。。。

这里收集了遇见的laravel 或则 lumen 错误 和解决方法。

controller或者model不存在

1. not found

Class '\App\UserController' not found

执行 composer dump-autoload 解决.

2. User模型默认在App下,迁移到Models下之后命名空间出了问题。

Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)
Class '\App\User' not found

User中修改命名空间:

use App\Models\User;

或者,您可以使用完整的名称空间:

$user = App\Models\User::find(1);

另外,请确保User.phpapp\Models目录中并确保您已更改config\auth.php文件中的模型:

'providers' => ['users' => ['driver' => 'eloquent','model' => App\Model\User::class,],
],

App\Http\Controllers\Auth\RegisterController中需要更改User的命名空间。

Unsupported driver [mongodb]。

lumen中使用mongodb报错:

Unsupported driver [mongodb]。

解决:

$app->register(Jenssegers\Mongodb\MongodbServiceProvider::class);$app->withFacades(); //这句移到$app->register下方,可解决

laravel Redis 队列错误

发现异步有些不会处理,https://laracasts.com/discuss... 同问这个问题,目前没有解决。

redis-climonitor 监控

1527832745.339231 [0 lua] "zrangebyscore" "queues:wechat_xcx:delayed" "-inf" "1527832745"
1527832745.339382 [0 127.0.0.1:59268] "EVAL" "-- Get all of the jobs with an expired \"score\"...\nlocal val = redis.call('zrangebyscore', KEYS[1], '-inf', ARGV[1])\n\n-- If we have values in the array, we will remove them from the first queue\n-- and add them onto the destination queue in chunks of 100, which moves\n-- all of the appropriate jobs onto the destination queue very safely.\nif(next(val) ~= nil) then\n redis.call('zremrangebyrank', KEYS[1], 0, #val - 1)\n\n for i = 1, #val, 100 do\n redis.call('rpush', KEYS[2], unpack(val, i, math.min(i+99, #val)))\n end\nend\n\nreturn val" "2" "queues:wechat_xcx:reserved" "queues:wechat_xcx" "1527832745"
1527832745.339440 [0 lua] "zrangebyscore" "queues:wechat_xcx:reserved" "-inf" "1527832745"
1527832745.339452 [1 127.0.0.1:53568] "EVAL" "-- Get all of the jobs with an expired \"score\"...\nlocal val = redis.call('zrangebyscore', KEYS[1], '-inf', ARGV[1])\n\n-- If we have values in the array, we will remove them from the first queue\n-- and add them onto the destination queue in chunks of 100, which moves\n-- all of the appropriate jobs onto the destination queue very safely.\nif(next(val) ~= nil) then\n redis.call('zremrangebyrank', KEYS[1], 0, #val - 1)\n\n for i = 1, #val, 100 do\n redis.call('rpush', KEYS[2], unpack(val, i, math.min(i+99, #val)))\n end\nend\n\nreturn val" "2" "queues:default:reserved" "queues:default" "1527832745"
1527832745.339503 [1 lua] "zrangebyscore" "queues:default:reserved" "-inf" "1527832745"
1527832745.339648 [0 127.0.0.1:59268] "EVAL" "-- Pop the first job off of the queue...\nlocal job = redis.call('lpop', KEYS[1])\nlocal reserved = false\n\nif(job ~= false) then\n -- Increment the attempt count and place job on the reserved queue...\n reserved = cjson.decode(job)\n reserved['attempts'] = reserved['attempts'] + 1\n reserved = cjson.encode(reserved)\n redis.call('zadd', KEYS[2], ARGV[1], reserved)\nend\n\nreturn {job, reserved}" "2" "queues:wechat_xcx" "queues:wechat_xcx:reserved" "1527832745"
1527832745.339694 [0 lua] "lpop" "queues:wechat_xcx"
1527832745.339722 [1 127.0.0.1:53568] "EVAL" "-- Pop the first job off of the queue...\nlocal job = redis.call('lpop', KEYS[1])\nlocal reserved = false\n\nif(job ~= false) then\n -- Increment the attempt count and place job on the reserved queue...\n reserved = cjson.decode(job)\n reserved['attempts'] = reserved['attempts'] + 1\n reserved = cjson.encode(reserved)\n redis.call('zadd', KEYS[2], ARGV[1], reserved)\nend\n\nreturn {job, reserved}" "2" "queues:default" "queues:default:reserved" "1527832805"
1527832745.339763 [1 lua] "lpop" "queues:default"
1527832745.807436 [1 127.0.0.1:53566] "GET" "laravel:illuminate:queue:restart"
1527832745.807651 [1 127.0.0.1:53566] "EVAL" "-- Get all of the jobs with an expired \"score\"...\nlocal val = redis.call('zrangebyscore', KEYS[1], '-inf', ARGV[1])\n\n-- If we have values in the array, we will remove them from the first queue\n-- and add them onto the destination queue in chunks of 100, which moves\n-- all of the appropriate jobs onto the destination queue very safely.\nif(next(val) ~= nil) then\n redis.call('zremrangebyrank', KEYS[1], 0, #val - 1)\n\n for i = 1, #val, 100 do\n redis.call('rpush', KEYS[2], unpack(val, i, math.min(i+99, #val)))\n end\nend\n\nreturn val" "2" "queues:default:delayed" "queues:default" "1527832745"
1527832745.807738 [1 lua] "zrangebyscore" "queues:default:delayed" "-inf" "1527832745"
1527832745.807863 [1 127.0.0.1:53566] "EVAL" "-- Get all of the jobs with an expired \"score\"...\nlocal val = redis.call('zrangebyscore', KEYS[1], '-inf', ARGV[1])\n\n-- If we have values in the array, we will remove them from the first queue\n-- and add them onto the destination queue in chunks of 100, which moves\n-- all of the appropriate jobs onto the destination queue very safely.\nif(next(val) ~= nil) then\n redis.call('zremrangebyrank', KEYS[1], 0, #val - 1)\n\n for i = 1, #val, 100 do\n redis.call('rpush', KEYS[2], unpack(val, i, math.min(i+99, #val)))\n end\nend\n\nreturn val" "2" "queues:default:reserved" "queues:default" "1527832745"
1527832745.807930 [1 lua] "zrangebyscore" "queues:default:reserved" "-inf" "1527832745"
1527832745.808092 [1 127.0.0.1:53566] "EVAL" "-- Pop the first job off of the queue...\nlocal job = redis.call('lpop', KEYS[1])\nlocal reserved = false\n\nif(job ~= false) then\n -- Increment the attempt count and place job on the reserved queue...\n reserved = cjson.decode(job)\n reserved['attempts'] = reserved['attempts'] + 1\n reserved = cjson.encode(reserved)\n redis.call('zadd', KEYS[2], ARGV[1], reserved)\nend\n\nreturn {job, reserved}" "2" "queues:default" "queues:default:reserved" "1527832805"
1527832745.808146 [1 lua] "lpop" "queues:default"

后来发现这个貌似不是错误,对队列没有影响。
开启supervisor后,自动监听任务,线程数决定刷新频率。(有懂的大神请指教)。

Whoops, looks like something went wrong.

APP_key 问题:
可使用重新生成

php artisan key:generate

在 Heroku 环境中也会有遇到,需要设置 heroku 的 key 和 项目一致:

heroku config:set APP_KEY=Your_app_key



推荐阅读
  • 工具系列 | 分布式日志管理graylog 实战
    Graylog是一个开源的日志聚合、分析、审计、展现和预警工具。功能上和ELK类似,但又比ELK要简单,依靠着更加简洁,高效, ... [详细]
  • Linux下安装grafana并且添加influxdb监控的方法
    这篇文章主要介绍了Linux下安装grafana并且添加influxdb监控的方法,本文给大家介绍的非常详细,具有一定的参考借鉴价值, ... [详细]
  • 淘宝http:ip.taobao.cominstructions.php接口说明请求接口(GET):servicegetIpInfo.ph ... [详细]
  • 对mysql的总结与反思_一次DB故障引起的反思和MySQL Operator选型
    前言在一次数据库故障后,我们发现业务库会根据业务的等级会划分多个MySQL实例,许多业务库会同时属于一个MySQL实例,当一个库引发问题后 ... [详细]
  • MongoDB用户验证auth的权限设置及角色说明
    本文介绍了MongoDB用户验证auth的权限设置,包括readAnyDatabase、readWriteAnyDatabase、userAdminAnyDatabase、dbAdminAnyDatabase、cluster相关的权限以及root权限等角色的说明和使用方法。 ... [详细]
  • 本文介绍了一个适用于PHP应用快速接入TRX和TRC20数字资产的开发包,该开发包支持使用自有Tron区块链节点的应用场景,也支持基于Tron官方公共API服务的轻量级部署场景。提供的功能包括生成地址、验证地址、查询余额、交易转账、查询最新区块和查询交易信息等。详细信息可参考tron-php的Github地址:https://github.com/Fenguoz/tron-php。 ... [详细]
  • Allegro总结:1.防焊层(SolderMask):又称绿油层,PCB非布线层,用于制成丝网印板,将不需要焊接的地方涂上防焊剂.在防焊层上预留的焊盘大小要比实际的焊盘大一些,其差值一般 ... [详细]
  • 一面自我介绍对象相等的判断,equals方法实现。可以简单描述挫折,并说明自己如何克服,最终有哪些收获。职业规划表明自己决心,首先自己不准备继续求学了,必须招工作了。希望去哪 ... [详细]
  • 1.安装brewinstallnginx(需要安装homebrew)2.执行nginx直接启动nginx服务3.nginx-sreloadstop4.配 ... [详细]
  • nsitionalENhttp:www.w3.orgTRxhtml1DTDxhtml1-transitional.dtd ... [详细]
  • Linux如何安装Mongodb的详细步骤和注意事项
    本文介绍了Linux如何安装Mongodb的详细步骤和注意事项,同时介绍了Mongodb的特点和优势。Mongodb是一个开源的数据库,适用于各种规模的企业和各类应用程序。它具有灵活的数据模式和高性能的数据读写操作,能够提高企业的敏捷性和可扩展性。文章还提供了Mongodb的下载安装包地址。 ... [详细]
  • phpcomposer 那个中文镜像是不是凉了 ... [详细]
  • 本文介绍了MongoDB中的覆盖索引查询(Covered Queries)的概念和使用方法。当查询的查询条件和查询计划中只包含索引属性时,MongoDB可以高效地执行查询操作,无需扫描documents或者将documents调入内存中。覆盖索引查询的条件是查询中的所有属性都是索引的一部分,并且查询结果中的属性值都在同一个索引中。通过使用覆盖索引查询,MongoDB可以直接从RAM中的索引中获取数据,比通过扫描文档读取数据要快得多。本文还提供了一个使用覆盖索引查询的示例。 ... [详细]
  • 本文介绍了关系型数据库和NoSQL数据库的概念和特点,列举了主流的关系型数据库和NoSQL数据库,同时描述了它们在新闻、电商抢购信息和微博热点信息等场景中的应用。此外,还提供了MySQL配置文件的相关内容。 ... [详细]
  • centos php部署到nginx 404_NodeJS项目部署到阿里云ECS服务器全程详解
    本文转载自:http:www.kovli.com20170919ecs-deploy作者:Kovli本文详细介绍如何部署NodeJS项目到阿里云ECS上, ... [详细]
author-avatar
痛彻心扉哥哥_742
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有