How to shutdown computer using PHP Script?

February 7, 2018 · 1 min read

PHP is a very popular language for developing a website. We can also control system by some PHP commands, In this article, I am going to show How to shutdown computer using PHP Script. We can control our system command from the web but we need to do one thing to enable Apache Configuration to use System Commands.

Windows

<?php system('shutdown -s -t 30');?> //here 30 means shutdown after 30 seconds.

We can also use the same parameter with function exec() and shell_exec() to Shutdown the Window Computers.

Linux

<?php system('shutdown -h now'); ?>

 

 

Get information about your memory and CPU usage in PHP
How to display Hindi in Website from Database(Tables)?
Share on Facebook
Facebook
Tweet about this on Twitter
Twitter
Share on LinkedIn
Linkedin
Pin on Pinterest
Pinterest