Great, I've sorted it - thanks for the quick reply Drew.
I'm new to all the server-side stuff, but my colleague did the
following in Putty:
yum install php-xml
Then rebooted Apache and it's working fine now.
phpinfo() still says '--disable-dom' but hKit is running with no
errors, so I'm happy with that!
----------------------------
I have another problem - this should be a bit easier to fix though I
think :)
I'm using Ajax to call a php script to look for the hCard and the
result is returned in JSON format.
The user types in their user name of, say, flickr and this is sent
through to the script using Ajax with the 'get' method.
This works fine, and returns correctly if there are no numbers or
special characters, eg '&', in the url, but otherwise just hangs.
Also, it works fine with numbers and special characters if I go to the
php page and append the url, eg
http://www.wooshare.com/hkit/get_profile.php?url=http://www.flickr.com/people/7307825@N08.
So I can only assume it's either something to do with the way I'm
sending the url through to the php script, or the way I'm sending the
url through to hKit.
Do I need to URL encode / decode or use htmlspecialchars?
Core code as follows:
$hKit = new hKit;
// Config options (see top of class file)
$hKit->tidy_mode = 'proxy'; // 'proxy', 'exec', 'php' or 'none'
if ($_GET['url']) {
$result = $hKit->getByURL('hcard', $_GET['url']);
if ($result) {
$o = ($json->encode($result));
$o = substr($o, 1, -1);
$ct = ($debug) ? 'text/plain' : 'application/json';
}
else {
$o = '404 Not Found';
$status = '404';
}
}
else {
$o = '400 Bad Request';
$status = '400';
}
header('Content-type: '.$ct);
switch($status) {
case '400':
header("HTTP/1.0 400 Bad Request");
break;
case '404':
header("HTTP/1.0 404 Not Found");
break;
case '200':
default:
header("HTTP/1.0 200 OK");
break;
}
print $o;
----------------------------
Many thanks for your help!
Sean
----------------------------