Note that the DirectAdmin plugin system can use php, however the php used is /usr/local/bin/php, and not the same php used by apache. The differences are that many of the default/loaded variables made available to php coders are no there by default with the command line version.
This is a basic php code to convert the environmentable variables that DA does pass, into the $_GET and $_POST arrays that you're used to working with through apache:
//make code look like CLI for $_GET and $_POST
$_GET = Array();
$QUERY_STRING=getenv('QUERY_STRING');
if ($QUERY_STRING != "")
{
parse_str(unhtmlentities($QUERY_STRING), $get_array);
foreach ($get_array as $key => $value)
{
$_GET[urldecode($key)] = urldecode($value);
}
}
$_POST = Array();
$POST_STRING=getenv('POST');
if ($POST_STRING != "")
{
parse_str(unhtmlentities($POST_STRING), $post_array);
foreach ($post_array as $key => $value)
{
$_POST[urldecode($key)] = urldecode($value);
}
}