ext-swooleis supported until v4.7.1, use
ext-openswoole>= v4.7.1. Latest version:
pecl install openswoole-4.9.1
<?php Swoole\Coroutine\FastCGI\Client->execute(Swoole\FastCGI\HttpRequest $request, float $timeout = -1): Swoole\FastCGI\HttpResponse
The built up FastCGI Client request object. This object is used to setup the request to send. It must be a
The default is to never time out (
-1) but you may set a timeout in seconds. So 1.5 means 1.5 seconds.
Swoole\\FastCGI\\HttpResponse object. You can catch any errors by using a try-catch with this client.
Execute the request to the FPM server and return the response.
Swoole\FastCGI\HttpResponse object contains the information from the FPM response.
The most commonly used request object is
Swoole\FastCGI\HttpRequest but you may also use
Swoole\FastCGI\Request which is used for when you are not sending a HTTP request. Refer to the documentation on the request and response objects for more details.
Any errors will thrown an
Swoole\Coroutine\FastCGI\Client\Exception, checkout the Dealing with errors section.
Checkout the main examples to see how this method is used and how to process a response.