What is the best practice for rebooting a Linux server using a PHP script?
Rebooting a Linux server using a PHP script can be achieved by executing a system command to restart the server. This can be done by using the `shell_exec()` function in PHP to run the `reboot` command. It is important to ensure that the PHP script has the necessary permissions to execute system commands.
<?php
// Execute the reboot command using shell_exec
$output = shell_exec('sudo reboot');
// Output the result of the command
echo $output;
?>