摘要:解決這句移到下方,可解決隊列錯誤發現異步有些不會處理,同問這個問題,目前沒有解決。開啟后,自動監聽任務,線程數決定刷新頻率。問題可使用重新生成在環境中也會有遇到,需要設置的和項目一致
持續更新。。。
這里收集了遇見的laravel 或則 lumen 錯誤 和解決方法。controller或者model不存在 1. not found
Class "AppUserController" not found
執行 composer dump-autoload 解決.
2. User模型默認在App下,遷移到Models下之后命名空間出了問題。Symfony Component Debug Exception FatalThrowableError (E_ERROR) Class "AppUser" not found
在User中修改命名空間:
use AppModelsUser;
或者,您可以使用完整的名稱空間:
$user = AppModelsUser::find(1);
另外,請確保User.php在appModels目錄中并確保您已更改configauth.php文件中的模型:
"providers" => [ "users" => [ "driver" => "eloquent", "model" => AppModelUser::class, ], ],
AppHttpControllersAuthRegisterController中需要更改User的命名空間。
Unsupported driver [mongodb]。在lumen中使用mongodb報錯:
Unsupported driver [mongodb]。
解決:
$app->register(JenssegersMongodbMongodbServiceProvider::class); $app->withFacades(); //這句移到$app->register下方,可解決laravel Redis 隊列錯誤
發現異步有些不會處理,https://laracasts.com/discuss... 同問這個問題,目前沒有解決。
redis-cli下 monitor 監控
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"... local val = redis.call("zrangebyscore", KEYS[1], "-inf", ARGV[1]) -- If we have values in the array, we will remove them from the first queue -- and add them onto the destination queue in chunks of 100, which moves -- all of the appropriate jobs onto the destination queue very safely. if(next(val) ~= nil) then redis.call("zremrangebyrank", KEYS[1], 0, #val - 1) for i = 1, #val, 100 do redis.call("rpush", KEYS[2], unpack(val, i, math.min(i+99, #val))) end end return 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"... local val = redis.call("zrangebyscore", KEYS[1], "-inf", ARGV[1]) -- If we have values in the array, we will remove them from the first queue -- and add them onto the destination queue in chunks of 100, which moves -- all of the appropriate jobs onto the destination queue very safely. if(next(val) ~= nil) then redis.call("zremrangebyrank", KEYS[1], 0, #val - 1) for i = 1, #val, 100 do redis.call("rpush", KEYS[2], unpack(val, i, math.min(i+99, #val))) end end return 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... local job = redis.call("lpop", KEYS[1]) local reserved = false if(job ~= false) then -- Increment the attempt count and place job on the reserved queue... reserved = cjson.decode(job) reserved["attempts"] = reserved["attempts"] + 1 reserved = cjson.encode(reserved) redis.call("zadd", KEYS[2], ARGV[1], reserved) end return {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... local job = redis.call("lpop", KEYS[1]) local reserved = false if(job ~= false) then -- Increment the attempt count and place job on the reserved queue... reserved = cjson.decode(job) reserved["attempts"] = reserved["attempts"] + 1 reserved = cjson.encode(reserved) redis.call("zadd", KEYS[2], ARGV[1], reserved) end return {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"... local val = redis.call("zrangebyscore", KEYS[1], "-inf", ARGV[1]) -- If we have values in the array, we will remove them from the first queue -- and add them onto the destination queue in chunks of 100, which moves -- all of the appropriate jobs onto the destination queue very safely. if(next(val) ~= nil) then redis.call("zremrangebyrank", KEYS[1], 0, #val - 1) for i = 1, #val, 100 do redis.call("rpush", KEYS[2], unpack(val, i, math.min(i+99, #val))) end end return 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"... local val = redis.call("zrangebyscore", KEYS[1], "-inf", ARGV[1]) -- If we have values in the array, we will remove them from the first queue -- and add them onto the destination queue in chunks of 100, which moves -- all of the appropriate jobs onto the destination queue very safely. if(next(val) ~= nil) then redis.call("zremrangebyrank", KEYS[1], 0, #val - 1) for i = 1, #val, 100 do redis.call("rpush", KEYS[2], unpack(val, i, math.min(i+99, #val))) end end return 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... local job = redis.call("lpop", KEYS[1]) local reserved = false if(job ~= false) then -- Increment the attempt count and place job on the reserved queue... reserved = cjson.decode(job) reserved["attempts"] = reserved["attempts"] + 1 reserved = cjson.encode(reserved) redis.call("zadd", KEYS[2], ARGV[1], reserved) end return {job, reserved}" "2" "queues:default" "queues:default:reserved" "1527832805" 1527832745.808146 [1 lua] "lpop" "queues:default"
后來發現這個貌似不是錯誤,對隊列沒有影響。
開啟supervisor后,自動監聽任務,線程數決定刷新頻率。(有懂的大神請指教)。
APP_key 問題:
可使用重新生成
php artisan key:generate
在 Heroku 環境中也會有遇到,需要設置 heroku 的 key 和 項目一致:
heroku config:set APP_KEY=Your_app_key
文章版權歸作者所有,未經允許請勿轉載,若此文章存在違規行為,您可以聯系管理員刪除。
轉載請注明本文地址:http://specialneedsforspecialkids.com/yun/28842.html
摘要:的現狀目前是版本,是基于開發。入口文件啟動文件和配置文件框架的入口文件是。在路由中指定控制器類必須寫全命名空間,不然會提示找不到類。目前支持四種數據庫系統以及。使用時發生錯誤,因為在文件中,的默認驅動是。 最近使用 Lumen 做了 2 個業余項目,特此記錄和分享一下。 Lumen 的介紹 在使用一項新的技術時,了解其應用場景是首要的事情。 Lumen 的口號:為速度而生的 La...
摘要:實現用戶友好的錯誤頁面非常簡單,例如想要返回,只需要在中添加一個文件即可。如何實現類用戶友好的錯誤頁面原理拋出錯誤的函數是進入該函數一看究竟,會發現只是拋出一個在中,處理的時候,有一個的過程,就是在這里被捕獲的。 Laravel5實現用戶友好的錯誤頁面非常簡單,例如想要返回status 404,只需要在view/errors中添加一個404.blade.php文件即可。Lumen中沒有...
摘要:什么是官網是一個由組件搭建而成的微框架是當前最快的框架之一在什么時候使用專為微服務或者設計舉個例子如果你的應用里面有部分業務邏輯的請求頻率比較高就可以單獨把這部分業務邏輯拿出來使用來構建一個小因為是對優化了框架的加載機制所以對資源的要求少很 什么是 Lumen?官網 lumen 是一個由 Laravel 組件搭建而成的微框架,是當前最快的 PHP 框架之一! 在什么時候使用 Lume...
閱讀 2210·2021-11-19 09:40
閱讀 1925·2021-11-08 13:24
閱讀 2460·2021-10-18 13:24
閱讀 2863·2021-10-11 10:57
閱讀 3588·2021-09-22 15:42
閱讀 1122·2019-08-29 17:11
閱讀 2532·2019-08-29 16:11
閱讀 2427·2019-08-29 11:11