Analytics reporting from PHP returns null

Hi All,

I am running a piwik setup on a server called (say) and I have a reporting script(implemented in php) running at (both ubuntu with PHP 5.3). When I try to access the stats from a browser using API (with format set as JSON, XML and PHP) I can see the stats, however when I try doing the same using from PHP file_get_contents($url) I keep getting blank output. Same thing happens when I use php5-curl.

One such url will be this

Any idea what could be happening ? I do have allow_url_fopen set to On in php,ini and Piwik version is 2.1.


if you are getting blank screen of death, check your server error logs for some info

I am getting xml/json/php output but its always zero when I call the url from script. The same url when accessed from browser does gives me a not zero numeric value.