Welcome, Guest
Please Login or Register.
Lost Password?
call list-available-scripts.pl from PHP (1 viewing)
Post Reply

TOPIC: call list-available-scripts.pl from PHP

#3560
derder (User)
Posts: 6
graphgraph
call list-available-scripts.pl from PHP 2007/01/14 16:59  
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.
  The administrator has disabled public write access.
#3561
derder (User)
Posts: 6
graphgraph
Re: call list-available-scripts.pl from PHP 2007/01/14 22:26  
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?
  The administrator has disabled public write access.
#3568
derder (User)
Posts: 6
graphgraph
Re: call list-available-scripts.pl from PHP 2007/01/15 12:23  
I got this to work via sockets
  The administrator has disabled public write access.
#11189
mac2000 (User)
Posts: 6
graphgraph
Re: call list-available-scripts.pl from PHP 2008/03/19 01:19  
can You please show worked example of using remote api from php?
  The administrator has disabled public write access.
#11226
Joe (Admin)
Posts: 3711
graph
Re: call list-available-scripts.pl from PHP 2008/03/20 09:19  
Code:

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

  The administrator has disabled public write access.
#11227
mac2000 (User)
Posts: 6
graphgraph
Re: call list-available-scripts.pl from PHP 2008/03/20 11:03  
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.
  The administrator has disabled public write access.
#11228
Joe (Admin)
Posts: 3711
graph
Re: call list-available-scripts.pl from PHP 2008/03/20 11:06  
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.
  The administrator has disabled public write access.
Post Reply
get the latest posts directly to your desktop

Talk and Get Help

Support
Forums
Bugs and Issues

Get Virtualmin

OS Support
Buy Online
Download
Copyright 2005-2007 Virtualmin, Inc. All rights reserved.