There is a system (EXEC) method inside PHP that can invoke the command.
Restart
First create a script (metaphor/root/reboot_server.sh), re-enable.//path may be casual, but must be guaranteed at least accessibleThe code is as follows:
#!/bin/Bash reboot
Give him permission again. 4755
Chown root:root/root///Set the user and user group that the current file belongs to 4755 /root/reboot_server.sh //Set permissions for the current file (readable , writable, executable)4777//Set/sbin/reboot permissions (there is no less, the original less this, and then the verification of each link, waste n more time)
In PHP again, try to make the following callThe code is as follows:
<? system("/root/reboot_server.sh"?>
The other functions are similar. For example: Shut down the machine
turn off the machineFirst create a script (metaphor/root/shutdown_server.sh), re-enable. The path can be casual, but at least the accessible code must be guaranteed as follows:
#!/bin/Bash reboot
Give him permission again. 4755
Chown root:root/root/shutdown_server.shchmod 4755/root/shutdown_server.sh
In PHP, try to do the following calling code as follows:
<? PHP System ("/root/shutdown_server.sh");?>
PHP--PHP controls Linux shutdown, restart, logoff