the heart of the issue is that it is not finding the key file:
<keyfile></keyfile>
the code to find the key file will look similar to:
$LinkPointAPI_required[0][$nextIndex] = "merchantinfo->keyfile";
$LinkPointAPI_required[1][$nextIndex] = "".realpath("../linkpoint/test.pem") ."";
the real path command should return a OS path to the file similar to:
/Applications/MAMP/htdocs/linkpoint/test.pem
in some cases, i have seen issue if the path contains /n or /t being interpreted as a new line or tab
So it may see:
/test.pem
and interpret that as "{tab}est.pem" (i put tab in {} for demonstration sake.)
if this is the case, you can get around the issue by hard coding the path to the pem file:
$LinkPointAPI_required[0][$nextIndex] = "merchantinfo->keyfile";
$LinkPointAPI_required[1][$nextIndex] = "/Applications/MAMP/htdocs/linkpoint/test.pem";