I have installed openswoole on my server and composer install mezzio-swoole package.
When I try to run Mezzio using Swoole as following:
I get the following error:
PHP Notice: Constant SWOOLE_LIBRARY already defined in /var/www/MezzioSwooleGRPC/vendor/swoole/library/src/constants.php on line 2 PHP Fatal error: Cannot redeclare swoole_exec() (previously declared in @swoole-src/library/std/exec.php:12) in /var/www/MezzioSwooleGRPC/vendor/swoole/library/src/std/exec.php on line 2
I need to know what are exactly needed to run Mezzio application using Swoole and benefit from both http/1.1 and http/2?
I want Mezzio application with Swoole to handle (process) both RestApi and Http2 (gRPC) requests.
Error already mentioned was due to Swoole-library package installed via composer on the project vendor. Hence, the error has been resolved.
So, my main questions about swoole are
1- How to get request (either RestApi or Http2 (gRPC)) and handle it?
2- How can I follow request in the mezzio-swoole package?
3- What are the base configurations to run mezzio using swoole?