I have a php script that execute an external script to perform a task on a linux host, the script utilizes exec php function to run external command as follows:
<?php
$user = "admin";
exec('cloudmonkey " list virtualmachines account=$user"', $outputArray);
echo implode("
", $outputArray);
?>
Result when running the script via command line
# php cs-functions.php
{
"count": 1,
"virtualmachine": [
{
"account": "admin",
"affinitygroup": [],
"cpunumber": 2,
"cpuspeed": 1000,
"created": "2015-04-02T12:11:41-0400",
"details": {
"hypervisortoolsversion": "xenserver56"
} ...etc
But when I access the page using a browser, I get a blank screen.
What is the issue here?
Your help is highly appreciated.
Thank you