Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recurring error every night with Who's Online lately


Guest

Recommended Posts

Posted

Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /home/xxx/public_html/xxx/xxx/whos_online.php:184 Stack trace: #0 /home/xxx/public_html/xxx/xxx/whos_online.php(184): SimpleXMLElement->__construct('') #1 /home/xxx/public_html/xxx/xxx/whos_online.php(221): updateIps() #2 /home/xxx/public_html/xxx/xxx/whos_online.php(379): add_geolocation() #3 {main} thrown in /home/xxx/public_html/xxx/xxx/whos_online.php on line 184

 

I installed the contrib (cannot remember what it is) that was an enhancement to Who's Online a year or more ago. My webhost recently upgraded from PHP 5.0 something to 5.2.14. I have no idea if that's even relevant here.

 

What does that error message mean?

Posted

I am having the same problem with the latest version of Who's Online Enhancement (3.6.7.2 - Synchronize all important changes)

 

In the database the looks to be filling properly.

 

if (!$d){
	//$backup = file_get_contents("http://backup.ipinfodb.com/ip_query2.php?ip=$ips");
	$ch = curl_init();
	$URL = ("http://ipinfodb.com/ip_query2.php?ip=$ips");
	//Set curl to return the data instead of printing it to the browser.
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	//Set the URL, then execute, then close
	curl_setopt($ch, CURLOPT_URL, $URL);
	$backup = curl_exec($ch);
	curl_close($ch);

	$answer = new SimpleXMLElement($backup);   <-- line 186 where the error occurs

Posted

I have the same problem too. It show up just today. Please, how to fix it ?

Paint for VietNamese :

Posted

The problem was that www.ipinfodb.com was down last night.

And an exception occurs in php when trying to process the xml result from ipinfodb...

 

Personnaly, I modify whosonline.php : before processing the answer from ipinfodb, I check if there's something to do with $backup.

 

It work when ipinfodb.com was down, And now it is working again with ipinfodb.com

 

near line 654:

$answer = new SimpleXMLElement($backup);

 

replace with :

if ($backup )

$answer = new SimpleXMLElement($backup);

Posted

Thanks,

 

In the latest version it is located around line 186,

 

I have changed it to:

		if ($backup) 
	{
	   $answer = new SimpleXMLElement($backup); 
	}

 

And it works again (or the server is back up :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...