php control linux server common functions shutdown restart open a new site
- 2020-05-19 04:22:59
- OfStack
php has an system method that calls system commands.
Create a script (metaphor /root/ reboot_server.sh) and restart it.
Give him authority 4755
chown root:root /root/reboot_server.sh
chmod 4755 /root/reboot_server.sh
chmod 4777 /sbin/reboot
In php, find a way to make the following call
Other functions are similar! Build your own virtual machine! Don't really hang out on the server
Create a script (metaphor /root/ reboot_server.sh) and restart it.
#!/bin/bash
reboot
Give him authority 4755
chown root:root /root/reboot_server.sh
chmod 4755 /root/reboot_server.sh
chmod 4777 /sbin/reboot
In php, find a way to make the following call
<?php
system("/root/reboot_server.sh");
?>
Other functions are similar! Build your own virtual machine! Don't really hang out on the server