Results 1 to 9 of 9
Thread: PHP Controlling Windows 2k
-
08-24-2002, 11:30 PM #1Disabled
- Join Date
- Aug 2002
- Posts
- 4
PHP Controlling Windows 2k
How would I create a php script that would be able to run certian commands on my windows 2000 server, all from a web interface control panel??? I know this is a tuf questions, but I just thought I would give it a try.
-
08-24-2002, 11:40 PM #2Quick, poke it with a stick!
- Join Date
- Jul 2001
- Location
- Troy, Missouri USA
- Posts
- 1,299
First you should download and install phpdev5 from http://www.firepages.com.au/ you will then have the ability to learn and test php on you PC. I have been using version 4 for about 4 months and ver. 5 for about 1 month. I found it is very stable and compatible.
Beta 5 worked as soon as it was installed no problem, it includes:
apache 1.3.26
apache 2.0.39
php4.2.2
MySQL4
phpmyadmin 2.3 (RC)
AnalogX php.ini configurator
PHP-GTK 0.51
PhpWebsiteSitekeeper
Google
-
08-25-2002, 12:14 AM #3Disabled
- Join Date
- Aug 2002
- Posts
- 4
K i just installed it
-
08-25-2002, 01:48 AM #4Newbie
- Join Date
- Aug 2002
- Posts
- 11
.. and then just use any of the system calls
-
08-26-2002, 03:04 PM #5Disabled
- Join Date
- Aug 2002
- Posts
- 4
OK, can you give me an example of a script that would execute "test.exe -text test +exec test.cfg" & be able to shut it down with a seperate command.
-
08-26-2002, 05:20 PM #6Junior Guru
- Join Date
- Dec 2001
- Location
- Blackpool, England
- Posts
- 180
<?php
system("the command you wanted to run");
?>
as for the closing it, cant think of a easy way of doing this under windows, been using linux to much. ud need to grab the process id and kill it
sorry cant be much more of a help
-
08-27-2002, 08:58 AM #7Junior Guru
- Join Date
- Jul 2001
- Location
- Wrapped in CAT5.
- Posts
- 217
Need proper permissions...
To be able to control aspects of Windows, you would need to make sure that the IIS user (normally 'the IIS anonymous user') has sufficient permission to execute various programs. This gets more complicated on a domain (if you wanted to automate DB creation on another box, for example) because this user must be a domain user.
Just something to keep in mind.
DanDan Esparza
CagedTornado web services
-
08-27-2002, 09:53 AM #8Web Hosting Master
- Join Date
- Jan 2002
- Location
- Kuwait
- Posts
- 679
Try this function:
http://www.php.net/manual/en/function.popen.php
-
08-27-2002, 01:28 PM #9Junior Guru
- Join Date
- Aug 2002
- Location
- Plymouth
- Posts
- 212
Try System() function call.
system() is just like the C version of the function in that it executes the given command and outputs the result. If a variable is provided as the second argument, then the return status code of the executed command will be written to this variable.