Virtualmin API Not Working Properly With PHP Script

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; ?>

Source: https://www.virtualmin.com/documentation/developer/http

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.

Thanks :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.