call list-available-scripts.pl from PHP

7 posts / 0 new
Last post
#1 Sun, 01/14/2007 - 16:59
derder

call list-available-scripts.pl from PHP

Do you have examples of calling list-available-scripts.pl 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.

Sun, 01/14/2007 - 22:26
derder

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?

Wed, 03/19/2008 - 01:19 (Reply to #2)
mac2000

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

Thu, 03/20/2008 - 09:19 (Reply to #3)
Joe
Joe's picture

[code:1]
<?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;
?>
[/code:1]

--

Check out the forum guidelines!

Thu, 03/20/2008 - 11:03 (Reply to #4)
mac2000

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.

Thu, 03/20/2008 - 11:06 (Reply to #5)
Joe
Joe's picture

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.

--

Check out the forum guidelines!

Mon, 01/15/2007 - 12:23
derder

I got this to work via sockets

Topic locked