I am using the code below to make use of the Virtualmin API using PHP,
<?php $result = [shell_exec](http://www.php.net/shell_exec)("wget -O - --quiet --http-user=root --http-passwd=pass --no-check-certificate 'https://localhost:10000/virtual-server/remote.cgi?program=list-domains'"); echo $result; ?>
But it’s now working as expected it is always giving error “You are already hosting this domain” and status “failed”
But the same command is working fine if I am using it from shell or CLI directly.
Please help me with this, I also request if someone has the API ready in PHP if he or she can provide.