[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 442
  • Last Modified:

PHP Page to Shutdown Windows

Hi, can someone tell me if I can use a PHP web page to run a standard shutdown command on a windows server.  If so how ?
0
frontpedal
Asked:
frontpedal
  • 2
1 Solution
 
FugasCommented:
http://php.net/manual/en/function.exec.php , but the user running IIS on server should have right to execute the shutdown command and in php.ini must be the EXEC function allowed
0
 
huangzhtaoCommented:
You can try the code below.
I tested it on my WampServer, it works.

<?php
$cmd3 = 'shutdown -s';
system($cmd3);
?>

Open in new window

0
 
huangzhtaoCommented:
PS you can also use passthru('shutdown -s') and exec('shutdown -s').
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now