初始化安装失败,php8.4,高版本需要兼容修复
原因: 错误 1. [2025-07-16T09:40:47+08:00][error] [8192]app\common\controller\Api::success(): Implicitly marking parameter $type as nullable is deprecated, the explicit nullable type must be used instead[E:\code\sadmin\app\common\controller\Api.php:73]
错误 2."Current PHP version: 8.4.10
{"code":0,"message":"Undefined constant app\\api\\controller\\Install::needDependentVersion","traces":
你的版本是否是v2.3.3-20250526,我在该版本的PHP 8.4.7下是正常的
虽然在PHP8版本隐式声明参数为可空(通过 = null 默认值)已被弃用。但并不影响实际操作。
如果需要显式,使用 ? 符号标记可空类型即可。
needDependentVersion traces在上述版本是正常使用的
wang@Mac-Pro sys % php think run
ThinkPHP Development server is started On <http://0.0.0.0:8000/>
You can exit with `CTRL-C`
Document root is: /Users/wang/Work/sys/public
[Mon Jul 21 10:25:53 2025] PHP 8.4.7 Development Server (http://0.0.0.0:8000) started
你似乎尚未安装BuildAdmin。
你可以考虑切换官方推荐的开发环境为PHP8.0.2或切换至PHP 8.4.7,并且检查版本是否为最新。
你的版本是否是
v2.3.3-20250526,我在该版本的PHP 8.4.7下是正常的 虽然在PHP8版本隐式声明参数为可空(通过 = null 默认值)已被弃用。但并不影响实际操作。 如果需要显式,使用?符号标记可空类型即可。needDependentVersion traces在上述版本是正常使用的
wang@Mac-Pro sys % php think run ThinkPHP Development server is started On http://0.0.0.0:8000/ You can exit with
CTRL-CDocument root is: /Users/wang/Work/sys/public [Mon Jul 21 10:25:53 2025] PHP 8.4.7 Development Server (http://0.0.0.0:8000) started 你似乎尚未安装BuildAdmin。你可以考虑切换官方推荐的
开发环境为PHP8.0.2或切换至PHP 8.4.7,并且检查版本是否为最新。
8.4.10 在安装环境检测那一步会报错,无法下一步安装,导致报错,我更换到php低版本了
请参考:https://ask.buildadmin.com/info/1674