下载
https://github.com/walkor/workerman-chat
运行到我的项目中后
爆一大堆的thinkphp8的错误,这下我就不知道怎么改了。。
Active code page: 65001
D:\laragon\www\web_page\public>php gateway_register.php gateway_gateway.php gateway_businessworker.php
---------------------------------------------- WORKERMAN -----------------------------------------------
Workerman version:4.1.15 PHP version:8.2.19
----------------------------------------------- WORKERS ------------------------------------------------
worker listen processes status
Register text://127.0.0.1:1236 1 [ok]
Fatal error: Uncaught ReflectionException: Class "app" does not exist in D:\laragon\www\web_page\vendor\topthink\framework\src\think\Container.php:377
Stack trace:
#0 D:\laragon\www\web_page\vendor\topthink\framework\src\think\Container.php(377): ReflectionClass->__construct('app')
#1 D:\laragon\www\web_page\vendor\topthink\framework\src\think\Container.php(253): think\Container->invokeClass('app', Array)
#2 D:\laragon\www\web_page\vendor\topthink\framework\src\think\Facade.php(47): think\Container->make('app', Array, false)
#3 D:\laragon\www\web_page\vendor\topthink\framework\src\think\Facade.php(97): think\Facade::createFacade()
#4 D:\laragon\www\web_page\vendor\hulang\think-addons\src\helper.php(13): think\Facade::__callStatic('getRootPath', Array)
#5 [internal function]: {closure}('app')
#6 D:\laragon\www\web_page\vendor\topthink\framework\src\think\Container.php(377): ReflectionClass->__construct('app')
#7 D:\laragon\www\web_page\vendor\topthink\framework\src\think\Container.php(253): think\Container->invokeClass('app', Array)
#8 D:\laragon\www\web_page\vendor\topthink\framework\src\think\Facade.php(47): think\Container->make('app', Array, false)
#9 D:\laragon\www\web_page\vendor\topthink\framework\src\think\Facade.php(97): think\Facade::createFacade()
#10 D:\laragon\www\web_page\vendor\hulang\think-addons\src\helper.php(13): think\Facade::__callStatic('getRootPath', Array)
#11 [internal function]: {closure}('Protocols\\Text')
#12 D:\laragon\www\web_page\vendor\workerman\workerman\Worker.php(2426): class_exists('Protocols\\Text')
#13 D:\laragon\www\web_page\vendor\workerman\workerman\Worker.php(2351): Workerman\Worker->parseSocketAddress()
#14 D:\laragon\www\web_page\vendor\workerman\workerman\Worker.php(1486): Workerman\Worker->listen()
#15 D:\laragon\www\web_page\vendor\workerman\workerman\Worker.php(1405): Workerman\Worker::forkWorkersForWindows()
#16 D:\laragon\www\web_page\vendor\workerman\workerman\Worker.php(560): Workerman\Worker::forkWorkers()
#17 D:\laragon\www\web_page\public\gateway_register.php(19): Workerman\Worker::runAll()
#18 D:\laragon\www\web_page\public\gateway_register.php(11): loadRegister()
#19 {main}
重新创建项目,里面不要有tp的东西
作者大佬啊,我项目是tp,你让我不要有tp的。。。我运行默认的那个可以
gateway_register.php 代码怎么写的?
gateway_register
gateway_gateway
gateway_businessworker
这样,你写个test.php
运行 php test.php 看下是否报错
报错,还和上面一模一样,这下,咋整啊。。晕了额。。
这个要问下tp了,就拿test.php代码示例去问就行
这个不是workerman这边的问题
好的,大佬,我现在就去tp的github提问去
start.php倒数第二行 加行 (new think\App())->http;