- Install dependencies:
composer install
- Start the webserver:
php -S localhost:8989
- Run the client:
php client.php
Expected behavior: request is completed successfully.
Actual behavior:
$ php client.php
* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 8989 (#0)
> GET /server.php?foo=bar HTTP/1.1
Host: localhost:8989
Connection: Upgrade, HTTP2-Settings
Upgrade: h2c
HTTP2-Settings: AAMAAABkAARAAAAAAAIAAAAA
User-Agent: GuzzleHttp/6.2.1 curl/7.53.1 PHP/7.1.3
* Empty reply from server
* Connection #0 to host localhost left intact
PHP Fatal error: Uncaught GuzzleHttp\Exception\ConnectException: cURL error 52: Empty reply from server (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:186
Stack trace:
#0 vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(150): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array)
#1 vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(103): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#2 vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#3 /Users/alcaeus/Co in vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php on line 186
Fatal error: Uncaught GuzzleHttp\Exception\ConnectException: cURL error 52: Empty reply from server (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php on line 186
GuzzleHttp\Exception\ConnectException: cURL error 52: Empty reply from server (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php on line 186
Call Stack:
0.0003 356608 1. {main}() client.php:0
0.0083 1112952 2. GuzzleHttp\Client->get() client.php:13
0.0083 1113328 3. GuzzleHttp\Client->__call() client.php:13
0.0083 1113328 4. GuzzleHttp\Client->request() vendor/guzzlehttp/guzzle/src/Client.php:87
0.0181 1410488 5. GuzzleHttp\Promise\RejectedPromise->wait() vendor/guzzlehttp/guzzle/src/Client.php:129