感謝評論區 @largezhou 的解答,直接解決問題
直接貼出答案希望給有用的人看到
將 nginx 的配置,這是我原來的
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k;
修改成如下,就是調大 buffers 值
fastcgi_buffer_size 1024k;
fastcgi_buffers 16 256k;
fastcgi_busy_buffers_size 2048k;
fastcgi_temp_file_write_size 4096k;
下面是原來的問題
求解決,本地 Laravel 的除錯頁面載入緩慢打不開
本地開發環境為 Win10 WSL 安裝的 Ubuntu 20 ,並安裝的 Lnmp 開發環境,php 版本為 8.1
Composer 安裝最新 Laravel 後,使用頁面等一切正常
storage bootstrap/cache 許可權也設定了 775
但就是有一個問題,開啟了配置檔案中的 Debug 為 true 後,除錯頁面一直在載入,載入長時間後停止,除錯模式檢視 url 最終返回 500
但是在除錯頁面右鍵檢視原始碼,開啟正常
以下提供相關資訊
php -m 檢視擴充套件如下
[PHP Modules]
bcmath
Core
ctype
curl
date
dom
fileinfo
filter
ftp
gd
gettext
hash
iconv
intl
json
libxml
mbstring
memcached
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
sysvsem
tokenizer
xml
xmlreader
xmlwriter
xsl
zip
zlib
[Zend Modules]
Storage 下的 log 日誌
[2023-04-10 07:43:00] local.ERROR: Symfony\Component\HttpKernel\Exception\HttpException::__construct(): Argument #1 ($statusCode) must be of type int, string given, called in /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php on line 1224 {"exception":"[object] (TypeError(code: 0): Symfony\\Component\\HttpKernel\\Exception\\HttpException::__construct(): Argument #1 ($statusCode) must be of type int, string given, called in /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php on line 1224 at /home/wwwroot/example-app/vendor/symfony/http-kernel/Exception/HttpException.php:24)
[stacktrace]
#0 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1224): Symfony\\Component\\HttpKernel\\Exception\\HttpException->__construct()
#1 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(45): Illuminate\\Foundation\\Application->abort()
#2 /home/wwwroot/example-app/routes/web.php(17): abort()
#3 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Routing/CallableDispatcher.php(40): Illuminate\\Routing\\RouteFileRegistrar->{closure}()
#4 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Routing/Route.php(237): Illuminate\\Routing\\CallableDispatcher->dispatch()
#5 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Routing/Route.php(208): Illuminate\\Routing\\Route->runCallable()
#6 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(798): Illuminate\\Routing\\Route->run()
#7 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#8 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#9 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()
#10 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#11 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle()
#12 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#13 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle()
#14 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#15 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest()
#16 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Session\\Middleware\\StartSession->handle()
#17 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#18 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle()
#19 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#20 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle()
#21 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#22 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(799): Illuminate\\Pipeline\\Pipeline->then()
#23 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(776): Illuminate\\Routing\\Router->runRouteWithinStack()
#24 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(740): Illuminate\\Routing\\Router->runRoute()
#25 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(729): Illuminate\\Routing\\Router->dispatchToRoute()
#26 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(200): Illuminate\\Routing\\Router->dispatch()
#27 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#28 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#29 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#30 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle()
#31 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#32 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#33 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
#34 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#35 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#36 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#37 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#38 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#39 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Http\\Middleware\\HandleCors->handle()
#40 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#41 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Http\\Middleware\\TrustProxies->handle()
#42 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#43 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(175): Illuminate\\Pipeline\\Pipeline->then()
#44 /home/wwwroot/example-app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(144): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#45 /home/wwwroot/example-app/public/index.php(52): Illuminate\\Foundation\\Http\\Kernel->handle()
#46 {main}
"}
php 日誌顯示,長時間請求後,頁面停止
[10-Apr-2023 15:39:11] WARNING: [pool www] child 1768, script '/home/wwwroot/example-app/public/index.php' (request: "GET ") execution timed out (131.666991 sec), terminating
[10-Apr-2023 15:39:11] WARNING: [pool www] child 1768 exited on signal 15 (SIGTERM) after 133.555864 seconds from start
[10-Apr-2023 15:39:11] NOTICE: [pool www] child 1811 started
從除錯頁面看,除錯頁面好像只載入了一部分,下面是除錯瀏覽器頁面截圖
希望有經驗大佬指點
PS:錯誤資訊我是隨便在路由 web.php 中返回個,測試除錯頁面用的
abort('aa');
本作品採用《CC 協議》,轉載必須註明作者和本文連結