php8.28安装不了报500错误
vbskycn opened this issue · 2 comments
vbskycn commented
宝塔 php8.2 所有的
新装php8.2,也关闭了跨站,直接显示500错误
切换到8.1后,就正常,是不支持8.2吗??
ichenhe commented
我也是,php 8.2.10 安装报错,如下:
[2024-01-08 10:39:04] prod.ERROR: Carbon\Carbon::setLastErrors(): Argument #1 ($lastErrors) must be of type array, bool given, called in /www/sites/img.chenhe.cc/index/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php on line 98 {"exception":"[object] (TypeError(code: 0): Carbon\\Carbon::setLastErrors(): Argument #1 ($lastErrors) must be of type array, bool given, called in /www/sites/img.chenhe.cc/index/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php on line 98 at /www/sites/img.chenhe.cc/index/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php:928)
[stacktrace]
#0 /www/sites/img.chenhe.cc/index/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php(98): Carbon\\Carbon::setLastErrors(false)
#1 /www/sites/img.chenhe.cc/index/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php(252): Carbon\\Carbon->__construct(NULL, NULL)
#2 /www/sites/img.chenhe.cc/index/vendor/laravel/framework/src/Illuminate/Support/InteractsWithTime.php(37): Carbon\\Carbon::now()
#3 /www/sites/img.chenhe.cc/index/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(208): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->availableAt(7200)
#4 /www/sites/img.chenhe.cc/index/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(191): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->newCookie(Object(Illuminate\\Http\\Request), Array)
#5 /www/sites/img.chenhe.cc/index/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(80): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->addCookieToResponse(Object(Illuminate\\Http\\Request), Object(Illuminate\\Http\\RedirectResponse))
#6 /www/sites/img.chenhe.cc/index/vendor/laravel/framework/src/Illuminate/Support/helpers.php(302): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->Illuminate\\Foundation\\Http\\Middleware\\{closure}(Object(Illuminate\\Http\\RedirectResponse))
#7 /www/sites/img.chenhe.cc/index/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): tap(Object(Illuminate\\Http\\RedirectResponse), Object(Closure))
#8 /www/sites/img.chenhe.cc/index/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#9 /www/sites/img.chenhe.cc/index/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#10 /www/sites/img.chenhe.cc/index/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
....
pengchangg commented
PHP 8.3.8 同样问题,依赖强制要求参数类型
两种解决方法:
- composer update
- 修改源码
./vendor/nesbot/carbon/src/Carbon/Traits/Creator.php:928
Old Line:
private static function setLastErrors(array $lastErrors)
New Line:
private static function setLastErrors($lastErrors)