Rehyved/php-http-client

Uncaught Error: Call to undefined function Rehyved\http\mb_stripos()

Closed this issue · 5 comments

I have loaded the php-http-client via Composer. When I try to run the following

\Rehyved\http\HttpRequest::create( "https://httpbin.org" )->get( "get" );

I get this error

Uncaught Error: Call to undefined function Rehyved\http\mb_stripos() in /app/northbubble/website/www.cobaltes.nl/private/xentriq/libraries/vendor/rehyved/php-http-client/src/rehyved/http/HttpResponse.php:41

I understand that the library has a dependency on mbstring but shouldn't this dependency be resolved by Composer?

Will investigate, thanks for the heads up. I guess these dependencies should be there if you have the appropriate php_mbstring module activated for PHP right?

This seems to also be covered by unit tests as this piece of code will always be triggered if there is any header set. Is the mbstring module installed on your system? Of course it is debatable if the mb function is actually needed here.

Missing mbstring seems to be the problem but Composer should warn/inform about this. You can ensure it does by adding this to the require section of the composer.json;

"ext-mbstring": "*",

Alright, will add. Do you think the use of mbstring is necessary?

Removed as it should not be needed