Without looking at the actual code and config files, I’m afraid I can’t help you spot the issue…
I’m guessing it may have to do with the carriage return and UNIX/Linux vs Windows [\r\n vs \n] or else there’s some other trailing char there but it’s only a guess.
I can also recommend is that you edit:
KalturaClientBase.php so that, right before:
$result = curl_exec($ch);
You have:
curl_setopt($ch, CURLOPT_VERBOSE, 1);
Then run it from the shell and see exactly what the request looks like and compare it with what it looks like when you use a literal string when setting $config->serviceUrl