新装webman启动报错

dsx5ds

问题描述

系统新装的,php8.1
安装了webman+admin
启动直接报错

看作者最近提交了修改,还原了一下就好了
/vendor/workerman/webman-framework/src/Http/Request.php on line 119
改为
public function file(?string $name = null): array

报错信息

Fatal error: Declaration of Webman\Http\Request::file($name = null) must be compatible with Workerman\Protocols\Http\Request::file(?string $name = null): mixed in /www/wwwroot/wuhu/vendor/workerman/webman-framework/src/Http/Request.php on line 119
Worker[13331] process terminated with ERROR: E_COMPILE_ERROR "Declaration of Webman\Http\Request::file($name = null) must be compatible with Workerman\Protocols\Http\Request::file(?string $name = null): mixed in /www/wwwroot/wuhu/vendor/workerman/webman-framework/src/Http/Request.php on line 119"
PHP Fatal error:  Declaration of Webman\Http\Request::file($name = null) must be compatible with Workerman\Protocols\Http\Request::file(?string $name = null): mixed in /www/wwwroot/wuhu/vendor/workerman/webman-framework/src/Http/Request.php on line 119
360 1 1
1个回答

walkor 打赏

可能你使用了composer代理,下载的 workerman/webman-framework 不是最新的。目前最新 workerman/webman-framework 为1.6.6

  • 达达尼黑 14天前

    我也是碰到这个问题,把 Webman\Http\Request 文件的119行这里改成与后面文件一样的?string $name = null) :mixed

  • walkor 14天前

    执行 composer require workerman/webman-framework ^1.6.6

×
🔝