Hi there,
The code below contains two test object instantiations - both work correctly from CLI, but second fails when run from SAPI.
<?php
$utils = & new COM("FISUtils.CFISUtils") or die('Some error:');
$domain = 'HWE';
$username = 'testuser';
$retval = $utils->GetGroups($username);
$groups = Array();
if ($retval != '::FAILED::')
{
foreach (split('&', $retval) as $group)
if (strlen($group) > 0)
$groups[] = strtolower($group);
if ($sorted)
asort($groups);
print_r($groups);
}
else
print_r(Array());
// SECOND OBJECT TEST
echo "\n\n";
$postcode = 'SO42 3TS';
$oLookup = new COM('ZapCodeWrapper.Zap');
if (!$oLookup)
{
echo 'Failed to create Zap instance';
}
else
{
if (strlen($postcode) > 0)
{
$address = $oLookup->GetAddress($postcode);
$bits = split("\r", $address);
$address = '';
foreach ($bits AS $bit)
{
if ($bit)
$address .= $bit."\n";
}
echo $address;
}
}
?>
I shall be very grateful if anyone has any idea why this second object may be failing. It runs as the same user (ME) whether CLI or webserver. PHP version 4.3.9
TIA
Nick