PHRETS icon indicating copy to clipboard operation
PHRETS copied to clipboard

Call to undefined function GuzzleHttp\Psr7\parse_response()

Open Reddogdesigns opened this issue 3 years ago • 3 comments

Hello I'm getting the following error when trying to run a search

Call to undefined function GuzzleHttp\Psr7\parse_response()

Any insight would be greatly appreciated.

Reddogdesigns avatar Aug 10 '21 20:08 Reddogdesigns

@Reddogdesigns I had the same issue, this is because parse_response has been depreciated and replaced with Message::parseResponse.

So the solution is to find the Multiple.php file. YOUR_APPLICATION_DIRECTORY/vendor/troydavisson/phrets/src/Parsers/GetObject/Multiple.php

And replace line 52: $parts = \GuzzleHttp\Psr7\parse_response("HTTP/1.1 200 OK\r\n" . $part . "\r\n"); with this: $parts = \GuzzleHttp\Psr7\Message::parseResponse("HTTP/1.1 200 OK\r\n" . $part . "\r\n");

samsafay avatar Aug 26 '21 19:08 samsafay

@samsafay this worked! Thank you so much!!!

Reddogdesigns avatar Aug 28 '21 22:08 Reddogdesigns

A safer workaround is to restrict the PSR7 package version in composer.json with "guzzlehttp/psr7": "^1.8",

Editing the vendor file is a temporary fix that will be lost as soon as composer update is ran again.

BrandonSurowiec avatar Dec 01 '21 14:12 BrandonSurowiec