这里详细描述问题
webman admin 本地好用,但是服务器就报错,刚开始服务器也好用,因为一直修改其它地方,没注意,不知道什么时候开始运行就报错了。一直没找到原因。
感觉是版本问题,我把vendor目录都删了,从本地上传上去依然报错。PHP版本也改成一致的,都是PHP8.2.3,大家有没有遇到过这是什么问题???
后来重新弄了个服务器,没有安装composer,直接把本地代码考上去,但是依然报错。本地就没问题
Fatal error: Declaration of Illuminate\Support\Collection::when($value, $callback, $default = null) must be compatible with Illuminate\Support\Enumerable::when($value, ?callable $callback = null, ?callable $default = null) in /share/project/shop_game_backed/vendor/illuminate/support/Traits/Conditionable.php on line 15
Worker[210136] process terminated with ERROR: E_COMPILE_ERROR "Declaration of Illuminate\Support\Collection::when($value, $callback, $default = null) must be compatible with Illuminate\Support\Enumerable::when($value, ?callable $callback = null, ?callable $default = null) in /share/project/shop_game_backed/vendor/illuminate/support/Traits/Conditionable.php on line 15"
worker[plugin.admin.task:210136] exit with status 65280
服务器是Debian,本地是Ubuntu
版本是
"require": {
"php": ">=7.2",
"workerman/webman-framework": "^1.5.0",
"monolog/monolog": "^2.0",
"webman/admin": "^0.6.28",
"webman/gateway-worker": "^1.0",
"psr/container": "^1.1.1",
"php-di/php-di": "^6.3",
"doctrine/annotations": "^1.14",
"webman/console": "^2.1",
"webman/event": "^1.0",
"workerman/gatewayclient": "^3.1",
"alipaysdk/openapi": "3.0.40",
"alipaysdk/easysdk": "*"
},
在服务器装个composer然后composer install很难么?
开始都装了,因为找不到报错原因,挪到新服务器才没安装
重新composer install
谢谢,已经好用了。必须把镜像改成腾讯云的才行,之前阿里云的镜像install很多次都不行
解决了,composer的库改成改成腾讯云之后,重新install好用了,阿里云是真不行。我本地很早之前改过了,服务器上当时忘改成腾讯的了,一直用的阿里的。所以怎么install,update都不好用。