HTTP authentication error with PHP script on Wowza server?

Is there a configuration / setting for the Wowza server that needs to be correct in order to allow HTTP authentication?

According to How to get a real-time connection account with Wowza Media Server , I have to get some XML information that I need. If I go to the URL from the browser, it will ask for a username / password and I will get the data, but if I try to execute it with PHP, it will fail no matter which method I use:

HTTP request failed! HTTP/1.0 401 Unauthorized

Method # 1:

$data = file_get_contents('http://admin:password@123.123.123.123:8086/connectioncounts');

Method # 2 :

$handle = fopen('http://admin:password@123.123.123.123:8086/connectioncounts', "r") 

Method # 3 :

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, http://123.123.123.123:8086/connectioncounts);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, "admin:password");
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
$output = curl_exec($ch);
+3
source share
1 answer

Try changing CURLAUTH_BASIC to CURLAUTH_ANY

+3

All Articles