PHP Control Linux Server common function shutdown Restart the new site, such as _php instance

Source: Internet
Author: User
There is a system method inside PHP that can invoke the systems command.
First create a script (metaphorically/root/reboot_server.sh), and re-enable it.
Copy Code code as follows:

#!/bin/bash
Reboot

and give him permission 4755.
Chown root:root/root/reboot_server.sh
chmod 4755/root/reboot_server.sh
chmod 4777/sbin/reboot

Again in PHP, try to do the following call
Copy Code code as follows:

<?php
System ("/root/reboot_server.sh");
?>

Other functions are similar! Install a virtual machine and play it yourself! Don't really hang out on the server.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.