I've been working on this for days, and the only solution I can find, that seems to work, is eval().
You can open a remote file using fopen, but the file has to be located in the PHP directory. Which it isn't in my case.
You can however do this locally
<?
$output = file(remoteIP/phpscript.php);
eval($output[0]);
echo "localvar = $localvar";
?>
and then on the remote machine
<?phpscript.php
$fp = popen(runscript);
$remotevar = fgets($fp);
//the single quotes are very important!
echo '$localvar='.$remotevar.';';
?>
using eval will evaluate the expression
$localvar = $remotevar;
then you can use $localvar,
on your local machine.
This is the only solution I found.
andre @ performance techologies