Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run GRPC Server Error:PHP Fatal error: Uncaught Error: Class "OpenSwoole\GRPC\Server" not found in #78

Open
atoat opened this issue Apr 11, 2024 · 1 comment

Comments

@atoat
Copy link

atoat commented Apr 11, 2024

I have checked the PHP extension and configured it numerous times. I'm sure there is no error.

php -m as follows:

image

php --ri openswoole as follows:

image

php code as follows:

`<?php

use Microservice\Admin\AdminService;
use OpenSwoole\GRPC\Middleware\LoggingMiddleware;
use OpenSwoole\GRPC\Middleware\TraceMiddleware;
use OpenSwoole\GRPC\Server;

$server = (new Server('127.0.0.1', 9501))
->register(AdminService::class)
->withWorkerContext('worker_start_time', function () {
return time();
})
// use middlewares
->addMiddleware(new LoggingMiddleware())
->addMiddleware(new TraceMiddleware())
->start();`

Why not? I'll be emotional. :(

@atoat
Copy link
Author

atoat commented Apr 11, 2024

Using Composer, the openswoole/grpc and openswoole/core extensions have been loaded.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant