I’m still having problems with the script. I changed the ‘connectioncounts’ port back to 8086, but i still get the following error. I can definately access the xml file directly through my browser, by going to “http://[myserverip]:8086/connectioncounts” but it simply won’t work in php. I checked my PHP config and all XML functions are enabled, yet it still returns this error. I am using no authentication either, so it should work.
Warning: DOMDocument::loadXML() [domdocument.loadxml]: Empty string supplied as input in /home/root/public_html/response.php on line 8
Fatal error: Call to a member function getElementsByTagName() on a non-object in /home/root/public_html/response.php on line 11
I have no idea what is happening. I’ll post my current code for you again.
[PHP]
<?php
$xml_data=file_get_contents("http://[myserverip]:8086/connectioncounts");
$doc = new DOMDocument();
$doc->loadXML($xml_data);
$wms = $doc->getElementsByTagName('WowzaMediaServer');
$currentlistener = $wms->item(0)->getElementsByTagName("ConnectionsCurrent")->item(0)->nodeValue;
$listenerhits = $wms->item(0)->getElementsByTagName("ConnectionsTotal")->item(0)->nodeValue;
echo "Current listener: $currentlistener
Total hits: $listenerhits";
?>
[/PHP]
Any more help would be really appreciated.