系统新装的,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
可能你使用了composer代理,下载的 workerman/webman-framework 不是最新的。目前最新 workerman/webman-framework 为1.6.6
我也是碰到这个问题,把 Webman\Http\Request 文件的119行这里改成与后面文件一样的?string $name = null) :mixed
执行
composer require workerman/webman-framework ^1.6.6