473,402 Members | 2,046 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Can I turn Off computer using PHP script

1
Can I turn off a computer using a PHP script?
May 27 '10 #1
1 4492
Atli
5,058 Expert 4TB
You can turn off the server computer, sure. Just use the exec function to execute the shutdown command for your OS. (The exact command varies between OSs).

For example, for a Linux server, you could do:
Expand|Select|Wrap|Line Numbers
  1. exec("shutdown -P now");
This, obviously, requires that PHP (or Apache, if PHP is run as an Apache module) is run by a user that is allowed to use that command. If not, you will not be able to do this.

If you are trying to shut down the computer's of a client (website visitor) then no, you can not. It's just basic security.
May 27 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Kenny Cheng | last post by:
Dear all Anyone knows that this problem has been patched? Is this a .NET 1.1 or 1.0 problem PRB: Cannot Unload Assemblies That You Create and Load by Using Script in XSL ...
4
by: Mohammed Abdel-Razzak | last post by:
Dear sirs I want to know how can I shutdown or restart my computer using C# Also I want to know how can I open any windows program using C# (EX: opening the windows calculator from my...
5
by: Won | last post by:
I want to know how to shut down computer using VB .NET. Thank you
10
by: Progman | last post by:
How do you get the IP address of a computer using ASP.net? I tried Request.UserHostAddress and it does not work. I get Request for the permission of type...
1
by: habeeb | last post by:
hello i need help, i want to know how we can access a table in Msaccess database of one computer using another computer. I tried by giving the path of one computer in the data source path of...
0
by: koh soo min | last post by:
Hi, Can anyone give me hints to write VB code for send and receive message between two computer using ComPort. Thanks.
2
by: yellowblueyellow | last post by:
Hi, I need a function to List all users in a group on a local computer using C#. any assistance would be much appreciated
4
by: wickedweapon | last post by:
Hi, I'm trying to access a remote computer and view its running processes thorugh WMI by using a script on my system but i keep getting "RPC server unavailable" error.I have changed the COM...
0
xxoulmate
by: xxoulmate | last post by:
how to extract username of computer using nbtstat., in dos mode i use nbtstat -a computername then it list down all the workgroup,the computername,and the username was there but the problem., is...
1
by: pnalla | last post by:
Hi, I am Connecting ti remote computer using C# WMI through the following code.But i t gives Some error "INVALID PARAMETERS" plse suggest me any modification in the code. try { ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.