call from PHP

Do you have examples of calling from with PHP? Of maybe there’s a better way to do this? I’d like to be able to initiate the install from within my own PHP-based web site instead of using virtualmin UI or the command line.

I found the remote API stuff. does anyone have examples of using this from PHP, I’m guessing either with socekts or something like wget?

I got this to work via sockets

can You please show worked example of using remote api from php?

$result = 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;

problem is that when i use such command i retrive welcome login page of webmin…

i, mean that parameters of wget http-user and http-password do not work, maybe i have some wrong configuration of webmin(virtualmin), maybe i need to cancel session parameter, or some other stuf?

please help.

Having session authentication is fine–Webmin can still accept HTTP basic auth (it’s the default, and it’s what we run on all of our boxes, and this example worked fine for me).

I’m not sure what else to tell you–are you sure your wget isn’t broken somehow? Maybe try from another system or build a different version. PHP has other ways to make HTTP requests, so you might want to try an alternative. I am not familiar enough with PHP to be much use in debugging–but the code I posted above works fine on a default Webmin/Virtualmin installation–no special configuration required, so I have to suspect something odd on your system.