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

Adapterman When running in - d mode, the program reports an error. #36

Open
euii opened this issue Apr 27, 2023 · 5 comments
Open

Adapterman When running in - d mode, the program reports an error. #36

euii opened this issue Apr 27, 2023 · 5 comments

Comments

@euii
Copy link

euii commented Apr 27, 2023

Test environment:
Mac 13.3.1
Workerman version:4.1.5
PHP version:8.1.17
Event-Loop:\Workerman\Events\Select
Adapterman: 0.6.1
Laravel : 9.33.0

The error message is as follows:

image

@joanhey
Copy link
Owner

joanhey commented Apr 27, 2023

I don't use Laravel.

But for me this problem is not from Adapterman or Workerman.
It's better to search a solution for this error in Laravel and your code.

Like you see, exist a lot of not instantiable errors without using Adapterman.
You are trying to instantiate an interface or abstract class, and that is impossible.
You need to configure correctly in your App.

Please try first to find a solution for Laravel, and later in Adapterman.

I'm busy now, but I'll try to create a page on typical errors in Laravel.
But the advise is the same than for Octane or Laravel-s (swoole).

Also a lot of libs are not ready to use in persistent apps, but with Octane more libs are adapting their code to work.

Any code will be very careful with singletons, static properties, bad static methods, globals, ... when using persistent applications.

@euii
Copy link
Author

euii commented Apr 28, 2023

https://laracasts.com/discuss/channels/laravel/laravel-8-to-9-upgrade-error-target-illuminatecontractsfoundationmaintenancemode-is-not-instantiable

I am not quite the same as these cases, my program works fine in php-fpm mode, running php artisan down and php artisan up is fine, it works fine when using php server.php start, and in the case of php server.php start -d also works fine when starting, and only when accessing the interface does the above error occur.

So my question is what exactly is the difference between workerman in daemon mode and not daemon mode?

@euii
Copy link
Author

euii commented Apr 28, 2023

Thank you very much for your reply, I tried to update the version to the latest yesterday, workerman to 4.1.9, Laravel to 9.52.7 and php to 8.1.18, but still the same problem appeared. Since my current old system is performing poorly under Laravel, I'm very interested in using adapterman to get the performance up. I want to solve this problem, but have no idea at all.

@Arnomic
Copy link

Arnomic commented May 6, 2023

$http_worker->onMessage = static function ($connection, $request) {
    $_SERVER['VAR_DUMPER_FORMAT'] = 'server'; // temp solution
    $connection->send(run());
};

@euii

@euii
Copy link
Author

euii commented May 7, 2023

$http_worker->onMessage = static function ($connection, $request) {
    $_SERVER['VAR_DUMPER_FORMAT'] = 'server'; // temp solution
    $connection->send(run());
};

@euii

Still not working, still the same error.

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

3 participants