Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8892477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:00:33+00:00 2026-06-14T23:00:33+00:00

I have an idea, and i have a single php local web page running

  • 0

I have an idea, and i have a single php local web page running on localhost

and i want to use GUI for 3 buttons : shut down , sleep and restart

Is PHP allows to me for these operations? Are there ready to write classes, methods in PHP?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T23:00:34+00:00Added an answer on June 14, 2026 at 11:00 pm

    If your Apache/PHP configuration is setup to allow the use of system, then you can use that.

    For *nix systems:

    system('shutdown now');    // shutdown
    // or
    system('reboot');          // reboot
    system('shutdown -r now'); // also reboot :)
    

    For Windows:

    system('shutdown -t -s 0'); // shutdown
    // or
    system('shutdown -r -t 0'); // reboot
    

    More info here.

    As far as sleep/standby on *nix is concerned, it varies a lot.


    Note: You can also use shell_exec() or exec().


    EDIT:

    Per user1597430’s comment, in *nix systems you can pass the -h (halt) option which will essentially shut down and halt the CPUs but not disconnect the main power.

    system('shutdown -h now'); // shutdown and halt
    system('shutdown -P now'); // shutdown and power off
    

    Server fault has some great answers here about this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Any one have an idea to share running multiple tomcats on single machine with
I have basic idea about running PHP in different configurations like mod_php, cgi, FastCGI,
I have an idea for a functional programming language design that makes heavy use
I have to use a single text box to use for search by order
I'm completly new to wordpress. I just want to use single javascript snippet on
I have a single point of entry on my website mysite.com/admin/index.php? View=List&Model=User All access
I have tried the following code in single.php file in wordpress. I used these
I have a web application, written in PHP that incorporates Javascript and JQuery, that
I have a php page that has multiple iframes on the page. these iframes
I have a single DB table (MySQL) which I am running a simple SELECT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.